MySQL 表分区 A PRIMARY KEY must include all columns in the table's partitioning function
来源:互联网 发布:八爪鱼数据采集能干嘛 编辑:程序博客网 时间:2024/05/29 05:58
当我们在对MySQL的数据表进行分区的时候,很容易碰到如下错误
A PRIMARY KEY must include all columns in the table’s partitioning function
意思是说分区的字段必须是要包含在主键当中。
所以当我们在使用 日期进行分区的时候,就需要将日期字段包含到主键当中去,
ALTER TABLE `order` PARTITION BY RANGE (to_days(create_time))(PARTITION p_Apr VALUES LESS THAN (to_days('2015-01-01')),PARTITION p_May VALUES LESS THAN (to_days('2016-11-01')),PARTITION p_Dec VALUES LESS THAN MAXVALUE );
否则会报错。不过以时间做为主键是比较少见的。
但是如果当数据库的表没有主键的时候,分区语句也能成功。
阅读全文
0 0
- MySQL 表分区 A PRIMARY KEY must include all columns in the table's partitioning function
- ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
- phoenix create table Order of columns in primary key constraint must match the order in which they'r
- ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index
- ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index SYS
- Nhibernate: Foreign key must have same number of columns as the referenced primary key
- PostgreSQL special sql 1 - list all the columns and primary key
- Hide the columns in table-control
- mysql用CATS方式备份数据报This table type requires a primary key错误
- 168.You execute this command to drop the ITEM table, which has the primary key referred in the ORDER
- Caused by: android.view.InflateException: You must specifiy a layout in the include tag: <include la
- You must specifiy a layout in the include tag: <include layout="@layout/layoutID" />
- Caused by: android.view.InflateException: You must specifiy a layout in the include tag: <include la
- Mysql删除表提示Cannot truncate a table referenced in a foreign key constraint解决办法
- mysql primary key key
- LOV for Editable Primary Key in ADF Table Problem
- TypeError: view must be a callable or a list/tuple in the case of include()
- TypeError: view must be a callable or a list/tuple in the case of include().
- iOS 7.0 以上一些弃用的系统API替换
- 未能加载文件或程序集“SrvCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”
- Logisitc Regrssion vs linear SVM
- 开通博客
- 安装RabbitMQ
- MySQL 表分区 A PRIMARY KEY must include all columns in the table's partitioning function
- GIT学习 day02
- 第四章 变量、作用域和内存问题
- MVC Action 返回类型[转]
- iOS开发 Swift3新特性
- 导出导入xml的实现
- Eclipse Maven project 报错:An error occurred while filtering resources 解决方法
- 我们为什么优化网站要做SEO?
- 解决bootstrap下拉菜单无法隐藏的问题