178. Rank Scores

select s1.score Score, count(*) Rank from Scores s1,
(select distinct score from scores) s2
where s1.score <= s2.score
group by id,s1.score
order by count(*)

posted @ 2018-10-24 20:19  ffeng0312  阅读(137)  评论(0)    收藏  举报