Score is well received: Select score from Scores ORDER by score Desc;
To get rank, you can get by comparing the number of score that are larger than the current score:
Select Score, (select COUNT (Distinct score) from Scores where Score>=s.score) Rank where Scores s order by score Desc;
Or:
Select S.score, COUNT (distinct T.score) Rank from Scores s join Scores t on S.score<=t.score
Get a join two tables,
{"Headers": ["Score", "score"], "values": [[3.50, 3.50], [3.50, 3.65], [3.65, 3.65], [3.65, 3.65], [3.50, 4.00], [3.65, 4. 00], [4.00, 4.00], [3.85, 4.00], [4.00, 4.00], [3.65, 4.00], [3.50, 3.85], [3.65, 3.85], [3.85, 3.85], [3.65, 3.85], [3.50 , 4.00], [3.65, 4.00], [4.00, 4.00], [3.85, 4.00], [4.00, 4.00], [3.65, 4.00], [3.50, 3.65], [3.65, 3.65], [3.65, 3.65]]}
Press S. The IDs are gathered together:
Select S.score, COUNT (distinct T.score) Rank from Scores s join Scores t on S.score<=t.scoregroup by S.idorder by S.scor E desc
Sql-leetcode 178. Rank Scores