NutzCN Logo
问答 创建表的时候能不能创建分区表?
发布于 2802天前 作者 qq_ea5df1f1 1674 次浏览 复制 上一个帖子 下一个帖子
标签:

创建表的时候,可不可以创建分区表,比如类似下面的sql

CREATE TABLE `test` (
`id`  int(11) NOT NULL AUTO_INCREMENT,
`ds`  int(11)  ,
PRIMARY KEY (`id`,`ds`) ,
UNIQUE INDEX `m_index` (`xx`, `xx`, `xx`, `xx`, `ds`) USING BTREE
)ENGINE=MyISAM  PARTITION BY List(`ds`) (
 PARTITION p_20170101 VALUES in (20170101),
 PARTITION p_20170102 VALUES in (20170102),
 PARTITION p_20170103 VALUES in (20170103),
 PARTITION p_20170104 VALUES in (20170104),
 PARTITION p_20170105 VALUES in (20170105),
 PARTITION p_20170106 VALUES in (20170106),
 PARTITION p_20170107 VALUES in (20170107),
 PARTITION p_20170108 VALUES in (20170108),
 PARTITION p_20170109 VALUES in (20170109),
 PARTITION p_20170110 VALUES in (20170110),
 PARTITION p_20170111 VALUES in (20170111),
 PARTITION p_20170112 VALUES in (20170112),
 PARTITION p_20170113 VALUES in (20170113),
 PARTITION p_20170114 VALUES in (20170114),
 PARTITION p_20170115 VALUES in (20170115),
 PARTITION p_20170116 VALUES in (20170116),
 PARTITION p_20170117 VALUES in (20170117),
 PARTITION p_20170118 VALUES in (20170118),
 PARTITION p_20170119 VALUES in (20170119),
 PARTITION p_20170120 VALUES in (20170120),
 PARTITION p_20170121 VALUES in (20170121),
 PARTITION p_20170122 VALUES in (20170122),
 PARTITION p_20170123 VALUES in (20170123),
 PARTITION p_20170124 VALUES in (20170124),
 PARTITION p_20170125 VALUES in (20170125),
 PARTITION p_20170126 VALUES in (20170126),
 PARTITION p_20170127 VALUES in (20170127),
 PARTITION p_20170128 VALUES in (20170128),
 PARTITION p_20170129 VALUES in (20170129),
 PARTITION p_20170130 VALUES in (20170130),
 PARTITION p_20170131 VALUES in (20170131)
)
;

4 回复

建表这种事还是不要靠nutz了吧,自己去建更妥贴。

@qq_4f9057d2 简单的表结构走dao.create很方便的

是的,还是自定义sql创建吧

添加回复
请先登陆
回到顶部