题解 | #查找入职员工时间排名倒数第三的员工所有信息#

查找入职员工时间排名倒数第三的员工所有信息

https://www.nowcoder.com/practice/ec1ca44c62c14ceb990c3c40def1ec6c

select emp_no,birth_date,first_name,last_name,gender,hire_date from (
    select *, dense_rank()over(order by hire_date desc) r from employees
) s
where s.r = 3

此题也可以用窗口函数写,dense_rank()输出并列连续的序号,不能用rank和row_number。

全部评论

相关推荐

最喜欢秋天的火龙果很...:第一份工作一定要往大的去,工资低点没事。后面换工作会更好找,即使你去小公司,你也不可能不会换工作的。所以找大的去
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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