Leetcode Database 178 RankScores
https://leetcode.com/problems/rank-scores/discuss/175194/Simple-using-variables
SELECT score , @rank := @rank + CASE WHEN @score <> (@score := score) THEN 1 ELSE 0 END as Rank
from Scores, (SELECT @score := -1, @rank := 0) init
order by Score DESC;
https://leetcode.com/problems/rank-scores/discuss/187650/Simple-Dense_Rank()-solution
select score, dense_rank() over ( order by Score desc) [Rank] from scores
https://blog.csdn.net/biaobiao1217/article/details/41077417