题解 | #获取员工其当前的薪水比其manager当前薪水#

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

https://www.nowcoder.com/practice/f858d74a030e48da8e0f69e21be63bef

select e.emp_no as emp_no,f.emp_no as manager_no,e.salary as emp_salary,f.salary as manager_salary
from(
select a.emp_no,a.dept_no,b.salary
from (dept_emp a)
inner join salaries b
on a.emp_no = b.emp_no
) as e
inner join
(
select c.emp_no,c.dept_no,d.salary
from (dept_manager c)
inner join salaries d
on c.emp_no = d.emp_no
) as f
on e.dept_no = f.dept_no and e.salary > f.salary

全部评论
同一部门内的才比较
点赞 回复 分享
发布于 2023-06-26 14:21 上海

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务