Home  • Database • MySQL

Rearrange auto increment column values in MySQL

ALTER TABLE `table` DROP `id`;
ALTER TABLE `table` AUTO_INCREMENT = 1;
ALTER TABLE `table` ADD `id` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

Comments 0


Share

Copyright © 2024. Powered by Intellect Software Ltd