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

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

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

select emp_no,
birth_date,
first_name,
last_name,
gender,
hire_date
from (select emp_no,
birth_date,
first_name,
last_name,
gender,
hire_date,
dense_rank()over(order by hire_date desc) 排名
from employees
) re
where re.排名=3
order by hire_date

这里的排名函数要看具体的排名规则,但题中出的有问题,他没有说明排名规则

如果这么写会存在一种问题,日期排序问题 两个日期相同是算一个排名还是两个排名?由于题中没具体说,所以无法判断

全部评论

相关推荐

码农索隆:以下是我以我微薄的认知提供的建议: 1.考个教师资格证,去当体育考试。 2.去健身房当健身教练(因为在我印象里面体育生身材都不错)。
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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