题解 | #查找入职员工时间排名倒数第三的员工所有信息#
查找入职员工时间排名倒数第三的员工所有信息
http://www.nowcoder.com/practice/ec1ca44c62c14ceb990c3c40def1ec6c
利用窗口函数解题
注意排序函数用dense_rank,相同日期的排名也相同,比如降序最晚的全都是第一名,第二晚的全都是第二名
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) a
where a.r=3
