mysql:
...
  id int auto_increment,
...

解决方案 »

  1.   

    create table tbl_name(id int(10) unsigned not null auto_incremnet primary key,
                           name varchar(10) not null,
                           birthday date not null,
                           tel varchar(13)
                          );
    如果你想在载一存在的表中增加一个子增的列,可以这样做:
    alter table tbl_name add id int(10) unsigned not null auto_increment primary key(默认是加在最后面)
    这样可以加在最前面:
    alter table tbl_name add id int(10) unsigned not null auto_increment primary key first
    这样可以加在某列后面:
    alter table tbl_name add id int(10) unsigned not null auto_increment primary key after columnname