SQL code
CREATE TABLE employees (
id INT NOT NULL,
fname VARCHAR(30),
lname VARCHAR(30),
hired DATE NOT NULL DEFAULT '1970-01-01',
separated DATE NOT NULL DEFAULT '9999-12-31',
job_code INT,
store_id INT
)
PARTITION BY RANGE ( datediff(separated,now()) ) (
PARTITION p0 VALUES LESS THAN 45,
PARTITION p1 VALUES LESS THAN 800,
PARTITION p2 VALUES LESS THAN 2001,
PARTITION p3 VALUES LESS THAN MAXVALUE
);
提示错误:
SQL code
ERROR 1064 (42000): Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ') (
PARTITION p0 VALUES LESS THAN 45,
PARTITION p1 VALUES LESS THAN 800,' at line 10
什么原因?
--转自
该贴由koei123转至本版2015-2-6 4:54:29