删除自增主键并新增主键

时间:2021-06-22 17:54:17   收藏:0   阅读:0
alter table student_info modify id int(3); -- 先删除自增约束

alter table student_info drop primary key; -- 再删除主键约束

alter table student_info drop id; -- 再删除该字段

alter table student_info add primary key(sno); -- 新增主键

 

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!