primary key

  • Post author:
  • Post category:其他


•id int primary key

•constraint pk_temp_id primary key(id)

•alter删除主键约束 :alter table temp drop primary key;

•alter添加主键 :alter table temp add primary key(name, pwd);

•alter修改列为主键 :alter table temp modify id int primary key;

•  设置主键自增:auto_increment

•id int auto_increment primary key,

转载于:https://my.oschina.net/u/3368968/blog/865325