SQL count与distinct的结合使用

select Score,(select count(distinct score) from Scores where score >= s.score) as Rank from Scores s order by score desc

select count(distinct score) from Scores

原文地址:https://www.cnblogs.com/yubufan/p/12302496.html