Leetcode178 Rank Scores Posted on 2020-02-22 In 数据库 Valine: Problem: Intuition:Solution:1234567891011SELECT S1.score 'Score', COUNT( DISTINCT S2.score ) 'Rank'FROM Scores S1 INNER JOIN Scores S2 ON S1.score <= S2.scoreGROUP BY S1.id, S1.scoreORDER BY S1.score DESC;