Open cjql opened 4 years ago
https://leetcode.com/problems/rank-scores/submissions/
SELECT Score, @rank := @rank + (@prev <> (@prev := Score)) Rank FROM Scores, (SELECT @rank := 0, @prev := -1) init ORDER BY Score desc
https://leetcode.com/problems/rank-scores/submissions/