在數據庫中添加一列,並設置自增
注意設置自增時要將該字段設置為主鍵,如果不指定插入位置則默認為列名的最后。
1 alter table test.student add column indexxx int(14) primary key auto_increment;
指定插入在某一列之后
1 alter table test.student add column indexxx int(14) primary key auto_increment after 列名;
指定插入到第一列
1 alter table test.student add column indexxx int(14) primary key auto_increment after first;