SELECT name,
percent,
@curRank := @curRank + 1 AS rank
FROM students s, (SELECT @curRank := 0) r
ORDER BY percent desc;
SELECT name,
percent,
dense_rank() over (order by percent desc) rating
FROM students
ORDER BY 1;