求薪水第二高,使用子查询,子查询查找
select emp_no, salary from salaries
where emp_no = (select emp_no from salaries order by salary desc limit 1, 1)
不用子查询
select emp_no, salary from salaries
order by salary desc limit 1, 1
求薪水第二高,使用子查询,子查询查找
select emp_no, salary from salaries
where emp_no = (select emp_no from salaries order by salary desc limit 1, 1)
不用子查询
select emp_no, salary from salaries
order by salary desc limit 1, 1