Numerical sequence of the autoincrementable ID

0

Someone knows how to do so that when I delete a row from my MySQL table, the following follow the numeric sequence of the autoincrementable ID? example, I have 10 rows with ID from 1 to 10, I delete rows 9 and 10, when I enter 2 new rows it looks like this: 1 2 3 4 5 6 7 8 11 12

    
asked by Marvin Morales 14.11.2017 в 22:32
source

1 answer

0

What you say can not be done, I do not like it visually either, but that is how the DBs work. You can only restart the id if you truncate the table, that is if you empty it. If you want to sort the users by age order I recommend adding a date column with the date at the moment of inserting them and then sorting according to that date.

    
answered by 14.11.2017 в 22:44