标签:用法 oracl sele sel span 排名 ecs student code
(1)rank over(order by 列名)------该函数只适用于oracle
例:
1 select sid, sname, rank() over (order by score) as srank from sc;
(2)rank over(partition by 列名,order by 列名)
例:
1 select name, age, score, rank() over (partition by age order by score decs) as rank_num from student;
(按年龄分组,组内按分数降序排名)
注:dense_rank() 连续排名
rank () 可不连续排名
标签:用法 oracl sele sel span 排名 ecs student code
原文地址:https://www.cnblogs.com/zhouxue0621/p/13614201.html