日期:2014-05-16  浏览次数:20751 次

mysql分区出现在查询中不能单独使用分区的错误
Script line: 80 Partitioning can not be used stand-alone in query near 'PARTITION BY RANGE (to_days(`time`))
(PARTITION p201203 VALUES LESS THAN (73495' at line 1


分区的时候出现这个错误是怎么回事?请指教!

------解决方案--------------------
没有其他错误信息了吗,在看哈错误日志吧,这信息太少了
------解决方案--------------------
贴下建表语句 和查询语句
------解决方案--------------------
分区的时间设置是否正确。
------解决方案--------------------
SQL code

PARTITION BY RANGE(TO_DAYS (createtime))
(
PARTITION p20101115 VALUES LESS THAN (TO_DAYS('2010-11-15')),
PARTITION p20101130 VALUES LESS THAN (TO_DAYS('2010-11-30')),
PARTITION p20101215 VALUES LESS THAN (TO_DAYS('2010-12-15')),
PARTITION p20101231 VALUES LESS THAN (TO_DAYS('2010-12-31')),
PARTITION p20110115 VALUES LESS THAN (TO_DAYS('2011-01-15')),
PARTITION p20110131 VALUES LESS THAN (TO_DAYS('2011-01-31')),