欢迎访问我的博客 https://javascript.shop

排名次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

posted @ 2017-07-09 15:04  孑孓子  阅读(145)  评论(0编辑  收藏  举报
欢迎访问我的博客 https://javascript.shop