题解 | #查找入职员工时间排名倒数第三的员工所有信息#
查找入职员工时间排名倒数第三的员工所有信息
https://www.nowcoder.com/practice/ec1ca44c62c14ceb990c3c40def1ec6c
hselect * from employees where hire_date = ( select distinct hire_date from employees order by hire_date desc limit 1 offset 2 )
先通过子查询获得倒数第三的员工入职的日期(先按照日期降序,入职时间一样的员工可能不止一个,通过distinct 关键字进行去重,然后 limit 和 offset的搭配 获得倒数第三的员工入职日期)
最后用where对日期进行筛选