select *
from (select *
from employees
order by hire_date desc
limit 0,3)
order by hire_date asc
limit 0,1
先找出入职时间最晚的三位员工信息,在从三位员工中找入职时间最早的。
limit 0,3 是从第0条记录开始,连找3条记录。
select *
from (select *
from employees
order by hire_date desc
limit 0,3)
order by hire_date asc
limit 0,1
先找出入职时间最晚的三位员工信息,在从三位员工中找入职时间最早的。
limit 0,3 是从第0条记录开始,连找3条记录。