2
我想在MySQL中創建表中包含分區MySQL表列
CREATE TABLE `ccd` (
`Created Month` varchar(255) DEFAULT NULL,
`Created` varchar(255) DEFAULT NULL,
`Employee Organization Name` varchar(255) DEFAULT NULL,
`Employee Login` varchar(255) DEFAULT NULL,
`Service Request #` varchar(255) DEFAULT NULL,
`Status` varchar(255) DEFAULT NULL,
`Description` longtext)
ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (SUBSTRING(`Created Month`,1,4) )
(PARTITION sp0 VALUES LESS THAN ('2010') ENGINE = MyISAM,
PARTITION sp1 VALUES LESS THAN ('2012') ENGINE = MyISAM,
PARTITION sp2 VALUES LESS THAN ('2014') ENGINE = MyISAM
);
在該表中,Created Month
列將具有象
Created Month
2011/02
2011/06
2012/02
2013/01
2013/02
2013/05
2013/05
,當我的價值觀分區試圖運行該聲明,我得到的錯誤消息,如
ERROR: This partition function is not allowed
Error Code: 1564
任何人告訴我,我犯了什麼錯誤..?
感謝您的答覆。 – CarlJohn
@CarlJohn:np,我也發佈了一個可以嘗試的解決方案 – Stephan