题解 | #对所有员工的薪水按照salary降序进行1-N的排名#

对所有员工的薪水按照salary降序进行1-N的排名

http://www.nowcoder.com/practice/b9068bfe5df74276bd015b9729eec4bf

select emp_no, salary, 
    dense_rank() over(order by salary desc) as rk
from salaries
where to_date = '9999-01-01'
order by salary desc, emp_no asc

终于懂最后一行了,同时有desc降序和asc升序时要每一个都区分标注好

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-02 15:39
点赞 评论 收藏
分享
05-09 13:22
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务