力扣数据库
1.最晚入职
where条件语句查询,选定的语句用一个子查询
select * from employees
where hire_date = (select max(hire_date) from employees);
2.倒数第三
distinct:不重复
LIMIT m,n : 表示从第m+1条开始,取n条数据;
select * from employees where hire_date=(select distinct hire_date from employees order by hire_date desc limit 2,1);
3.多表连接:注意确定主表
select s.* ,d.dept_nofrom salaries as s join dept_manager as d on s.emp_no=d.emp_nowhere s.to_date = '9999-01-01' and d.to_date=