sql >> Base de Datos >  >> RDS >> Mysql

¿Cómo reordenar una clave principal?

Prueba esto:

SET @var:=0;
UPDATE `table` SET `id`=(@var:example@sqldat.com+1);
ALTER TABLE `table` AUTO_INCREMENT=1;