SET @num := 0;
UPDATE table_name SET id = @num := (@num+1);
ALTER TABLE table_name AUTO_INCREMENT =1;
SET @num := 0;
UPDATE table_name SET id = @num := (@num+1);
ALTER TABLE table_name AUTO_INCREMENT =1;
本文标题:MYSQL在不删除数据的情况下,重置主键自增id
本文链接:https://www.haomeiwen.com/subject/rscdqltx.html
网友评论