排名次SQL语句【名次可重复时】

原文发布时间为:2008-10-26 —— 来源于本人的百度文章 [由搬家工具导入]

功能实现 名次可重复时,比如第一名有两个。。。

select   *,(select   count(distinct score) from   paper a where   a.score >= b.score ) mingci from   paper b order by score desc

如:

2   3    90   1

3    4   90   1

1   5    80   2

4   56   23 3

原文地址:https://www.cnblogs.com/handboy/p/7141579.html