Oracle 
rank()和dense_rank()的区别是: 
–rank()是跳跃排序,有两个第二名时接下来就是第四名 
–dense_rank()l是连续排序,有两个第二名时仍然跟着第三名

select sno,cno,score,
rank() over(partition by cno order by score desc) "名次"
from sc;
--名次不跳跃 两个第二名 接下来还是第三名
select sno,cno,score,
dense_rank() over(partition by cno order by score desc) "名次"
from sc;
 posted on 2018-03-25 19:38  做个快乐的自己  阅读(582)  评论(0编辑  收藏  举报