Mysql 常用总结

1、自增列

只有int类型且为primary key 才可以使用auto_increment。且自增列的步长是针对实例设置的不能针对某个表设置

SHOW VARIABLES LIKE 'auto_inc%';

alter table album change ALBUM_ID ALBUM_ID bigint not null auto_increment;
alter table album auto_increment=1;

create table cc(id int auto_increment,name varchar(20),primary key(id));

posted on 2015-03-06 15:52  多渔.余  阅读(159)  评论(0编辑  收藏  举报

导航