What command can I use to rearrange the ID of all items in a table?
The name of the table is produtos
and the column is id
.
Currently they look like this:
id: 1 - 3 - 7 - 8 - 9 - 11 ...
That is, they are not in the correct sequence.
I need to leave them this way:
id : 1 - 2 - 3 - 4 - 5 - 6 - 7 ...
But it is important that he follow the correct sequence not to mix, eg:
1 = 1
3 = 2
7 = 3
8 = 4
9 = 5
11 = 6
The server is MySQL.