有个需求:需要给数据列表添加一个序号(序号为1、2、3....),需要自增
alter table table_name add num(序号) int auto_increment not null Unique;
需加unique才能设置自增成功,否则会报错
Incorrect table definition; there can be only one auto column and it must be defined as a key
有个需求:需要给数据列表添加一个序号(序号为1、2、3....),需要自增
alter table table_name add num(序号) int auto_increment not null Unique;
需加unique才能设置自增成功,否则会报错
Incorrect table definition; there can be only one auto column and it must be defined as a key