mysql - Reorder / reset auto increment primary key -


i have mysql table auto increment primary key. deleted rows in middle of table. have, example, in id column: 12, 13, 14, 19, 20. deleted 15, 16, 17 , 18 rows.

i want reassign / reset / reorder primary key have continuity, i.e. make 19 15, 20 16, , on.

how can it?

you drop primary key column , re-create it. ids should reassigned in order.

however bad idea in situations. if have other tables have foreign keys table not work.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -