题解 | #查找入职员工时间排名倒数第三的员工所有信息#
查找入职员工时间排名倒数第三的员工所有信息
http://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) a from employees ) as univ_min WHERE a=3;
方法二(limit):SELECT *
FROM employees
WHERE hire_date = (
SELECT DISTINCT hire_date
FROM employees
ORDER BY hire_date DESC
LIMIT 2,1
);