代码改变世界

MySQL在已有数据的情况下添加新的自增主键字段

2023-02-23 14:57  abce  阅读(167)  评论(0编辑  收藏  举报
alter table `tabname` add `id` bigint not null auto_increment first, add primary key (`id`);

备注:这条语句需要一次完全