1 頁 (共 1 頁)

How to reset AUTO_INCREMENT in MySQL?

發表於 : 2017-08-22 16:02:51
yehlu
https://stackoverflow.com/questions/892 ... t-in-mysql

代碼: 選擇全部

SET  @num := 0;

UPDATE your_table SET id = @num := (@num+1);

ALTER TABLE your_table AUTO_INCREMENT =1;