题解 | #获取当前薪水第二多的员工
获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
https://www.nowcoder.com/practice/c1472daba75d4635b7f8540b837cc719
select s.emp_no,s.salary,last_name,first_name from employees e inner join salaries s on e.emp_no=s.emp_no having s.salary=(select max(s1.salary) from salaries s1 where s1.salary<( select max(s2.salary) from salaries s2 ))
这道题恶心就恶心在需要用group by ,但明显是一个无意义的操作。
记得要用group by 后面加上 你join 的字段,不然会报错
#23届找工作求助阵地#