Let\'s say that I\'ve got a table, like that (id is auto-increment):
id | col1 | col2 1 | \'msg\'| \'msg\' 2 | \'lol\'| \'lol2\' 3 | \'xxx\'| \'x\'
You can renumber the whole table like this:
SET @r := 0; UPDATE mytable SET id = (@r := @r + 1) ORDER BY id;