版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
1、标识列(自增长列)
1、一个表只能有一个表示列;
2、表示列只能是数值型;
3、通过设置set auto_increment_increment来设置增长值(步长),可以通过插入来设置初始值;
create table tab_identity(
id int primary key auto_increment,
name varchar(10)
);
insert into tab_identity(name) values('zhangsan');
- 修改增长值
show variables like '%auto_inrement%';
set auto_increment_increment=3;
insert into tab_identity(name) values('zhangsan');