LeetCode.178. 分数排名
思路:

即无间隔排名。对于每个数字比较分数中有多少个大于等于自己的数,即为自身排名。

代码:

select Score,
(select count(distinct Score) from Scores as s2 where s2.Score >= s1.Score) as Rank 
from Scores as s1
order by Score DESC;

相关文章:

  • 2021-07-20
  • 2021-11-29
  • 2022-12-23
  • 2021-04-16
  • 2022-01-28
  • 2021-12-05
  • 2021-08-07
  • 2021-06-13
猜你喜欢
  • 2022-01-27
  • 2022-12-23
  • 2022-02-10
  • 2022-01-09
  • 2021-12-09
  • 2021-06-07
  • 2022-12-23
相关资源
相似解决方案