在mysql5.1中建立分区表的语句中,MySQL分区表只能包含下列函数:
ABS()
CEILING() and FLOOR() (在使用这2个函数的建立分区表的前提是使用函数的分区键是INT类型),例如
- mysql> CREATE TABLE t (c FLOAT) PARTITION BY LIST( FLOOR(c) )(
- -> PARTITION p0 VALUES IN (1,3,5),
- -> PARTITION p1 VALUES IN (2,4,6)
- -> );;
- ERROR 1491 (HY000): The PARTITION function returns the wrong type
- mysql> CREATE TABLE t (c int) PARTITION BY LIST( FLOOR(c) )(
- -> PARTITION p0 VALUES IN (1,3,5),
- -> PARTITION p1 VALUES IN (2,4,6) -> );
- Query OK, 0 rows affected (0.01 sec)
DAY()
DAYOFMONTH()
DAYOFWEEK()
DAYOFYEAR()
DATEDIFF()
EXTRACT()
HOUR()
MICROSECOND()
MINUTE()
MOD()
MONTH()
QUARTER()
SECOND()
TIME_TO_SEC()
TO_DAYS()
WEEKDAY()
YEAR()
YEARWEEK()