数据库的标识列

  作者:记性不好的阁主

概念:





创建表示设置标识列


create table tab_identity(
  id int primary key auto_increment ,
  t_name varchar(20)
);


设置自增步长

set auto_increment_increment=3;


显示步长

show variables like '%auto_increment%';


修改表时设置标识列

alter table tab_identity modify column id int primary key auto_increment;


修改表时删除标识列

alter table tab_identity modify column id int;


相关推荐

评论 抢沙发

表情

分类选择