mysql 设置自增字段
1.设置自增id通常的设置自增字段的方法:创建表格时添加:create table table1(id int auto_increment primary key,…)创建表格后添加:alter table table1 add id int auto_increment primary key 自增字段一定要设置为primary key.希望table中数据的id不要从1开始 i...
·
设置自增id
通常的设置自增字段的方法:
创建表格时添加:
create table table1(id int auto_increment primary key,…)
创建表格后添加:
alter table table1 add id int auto_increment primary key 自增字段
一定要设置为primary key.
希望table中数据的id不要从1开始 id从100开始,代码如下:
alter table users AUTO_INCREMENT=100;
更多推荐
已为社区贡献1条内容
所有评论(0)