I'm familiar with Oracle and would normally do a RANK() (ORDER BY score DESC) AS rank to get a rank like this:
Score | Rank
--------------
100 | 1
100 | 1
99 | 3
98 | 4
98 | 4
98 | 4
97 | 7
I haven't got the foggiest how to do this in MySQL - after looking on here, I've found this:
SET @prev_value = NULL;
SET @rank_count = 0;
SELECT score
, CASE
WHEN @prev_value = score
THEN @rank_count
WHEN @prev_value := score
THEN @rank_count := @rank_count + 1
END AS rank
FROM ...
but this returns it as:
Score | Rank
--------------
100 | 1
100 | 1
99 | 2
98 | 3
98 | 4
98 | 4
97 | 5
Which isn't quite what I wanted.