alter table user modify id int auto_increment;
SQLServer 语句:
create table tableName( id int identity(1,1) primary key, data varchar(50))
解释:其中identity(1,1)代表自增,第一个1代表从1开始计数,第二个1代表每次增长1。
mysql不用identity用 AUTO_INCREMENT
create table tableName( id int auto_increment primary key, data varchar(50))