SELECT
score,
(SELECT COUNT(DISTINCT score) FROM Scores WHERE score >= s.score) AS `rank`
FROM Scores AS s
ORDER BY score DESC;
SELECT s1.Score, COUNT(DISTINCT(s2.Score)) AS Rank
FROM Scores s1 JOIN Scores s2
WHERE s1.score<=s2.score
GROUP BY s1.Id
ORDER BY Rank;