remover índice no id faça algo assim: SET @rank:=0; update users set example@sqldat.com:example@sqldat.com+1 order by id; adicionar índice no id