码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2017-07-09 16:23:48      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:select   百度   可重复   paper   rom   desc   sql语句   font   sel   

原文发布时间为: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

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

标签:select   百度   可重复   paper   rom   desc   sql语句   font   sel   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!