牛客SQL25--获取员工其当前的薪水比其manager当前薪水还高的相关信息

MYSQL:

select de.emp_no,dm.emp_no as manager_no,
s1.salary as emp_salary,s2.salary as manager_salary
from dept_emp de,dept_manager dm,salaries s1,salaries s2
where de.dept_no=dm.dept_no
and de.emp_no=s1.emp_no
and dm.emp_no=s2.emp_no
and s1.salary>s2.salary
and s2.to_date='9999-01-01'
and s1.to_date='9999-01-01';

 

上一篇:mysql基础(三)


下一篇:大数据开发之Spark SQL/Hive实用函数分享