"<br />
ALTER TABLE table_name ADD COLUMN new_id INT NOT NULL;<br />
SET @x = 0;<br />
UPDATE table_name SET new_id = (@x:=@x+1) ORDER BY whateveryouwant ASC;<br />
ALTER TABLE table_name ADD PRIMARY KEY new_id (new_id);<br />
ALTER TABLE table_name CHANGE new_id new_id INT NOT NULL AUTO_INCREMENT;<br />
"<br />
<br />
update players as p <br />
set p.id = (<br />
    SELECT count(*) from (select id from players) as sub <br />
    where p.id > sub.id<br />
)