我想在MySQL中创建一个具有分区功能的表。以下是我的尝试:
-- CREATE TABLE
CREATE TABLE IF NOT EXISTS tick_data
(
stock_ticker VARCHAR(20) NOT NULL
, tick_datetime DATETIME NOT NULL
, price DOUBLE NOT NULL
, size INT NOT NULL
, auto_inc BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY
)
PARTITION BY LIST(MONTH(tick_datetime)) (
PARTITION p0 VALUES IN (1),
PARTITION p1 VALUES IN (2),
PARTITION p2 VALUES IN (3),
PARTITION p3 VALUES IN (4),
PARTITION p4 VALUES IN (5),
PARTITION p5 VALUES IN (6),
PARTITION p6 VALUES IN (7),
PARTITION p7 VALUES IN (8),
PARTITION p8 VALUES IN (9),
PARTITION p9 VALUES IN (10),
PARTITION p10 VALUES IN (11),
PARTITION p11 VALUES IN (12),
);
有人可以告诉我为什么使用上述代码创建表时会出现语法错误吗?