步骤分解
- 查找入职员工的所有信息,并按照入职时间倒序排序
select * from employees order by hire_date DESC;
- 用offset跳过1的前2条查询结果,用limit取第3条查询结果
select * from employees order by hire_date DESC limit 1 offset 2;
注意:用limit 1 offset 2时,应提前观察select * from employees中,只有一位入职员工时间排名倒数第三
完整答案
select * from employees order by hire_date DESC limit 1 offset 2;