💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ create table p_range2( id int primary key auto_increment, name varchar(32), birthday date )engine myisam charset utf8 partition by range (month(birthday))( partition p_1 values less than (3), partition p_2 values less than (6), partition p_3 values less than(9), partition p_4 values less than MAXVALUE ); ~~~ **错误 : A PRIMARY KEY must include all columns in the table's partitioning function** 注意:创建分区的字段必须是主键/唯一 或主键/唯一 的一部分 ~~~ create table p_range2( id int auto_increment, name varchar(32), birthday date, primary key(id,birthday) )engine myisam charset utf8 partition by range (month(birthday))( partition p_1 values less than (3), partition p_2 values less than (6), partition p_3 values less than(9), partition p_4 values less than MAXVALUE ); ~~~ 分区字段也可以是唯一索引的一部分 ~~~ create table p_range3( id int auto_increment, name varchar(32), birthday date, unique key(id,birthday) )engine myisam charset utf8 partition by range (month(birthday))( partition p_1 values less than (3), partition p_2 values less than (6), partition p_3 values less than(9), partition p_4 values less than MAXVALUE ); ~~~