Open yokostan opened 5 years ago
COUNT EVERYTHING BIGGER:
# Write your MySQL query statement below SELECT s.Score, (SELECT COUNT(DISTINCT Score) FROM Scores WHERE Score >= s.Score) as Rank FROM Scores as s ORDER BY s.Score DESC
https://leetcode.com/problems/rank-scores/discuss/53094/Simple-Short-Fast
COUNT EVERYTHING BIGGER: