#入职员工时间有可能重复,题目也没规定同一入职时间的员工算排名时是否相同。因此我们只能具体问题具体分析,看输入中发现大家的入职时间有相同的的,因此需要用distinct 加ORDER BY进行筛选
select *
from employees
WHERE hire_date=(SELECT distinct hire_date from employees order by hire_date desc limit 2,1)
#入职员工时间有可能重复,题目也没规定同一入职时间的员工算排名时是否相同。因此我们只能具体问题具体分析,看输入中发现大家的入职时间有相同的的,因此需要用distinct 加ORDER BY进行筛选
select *
from employees
WHERE hire_date=(SELECT distinct hire_date from employees order by hire_date desc limit 2,1)