题解 | #获取当前薪水第二多的员工的emp_no以及其对应的薪水salary#
获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
http://www.nowcoder.com/practice/c1472daba75d4635b7f8540b837cc719
获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
内联接与子查询
select e.emp_no, salary , last_name , first_name from employees e join salaries s on s.emp_no = e.emp_no where salary = ( select max(salary) from salaries where salary <> ( select max(salary) from salaries where to_date='9999-01-01' ) )
学习mysql,可以看相关的总结博客: