181. 超过经理收入的员工

# Write your MySQL query statement below
select a.Name as 'Employee'
from Employee as a,Employee as b
where a.ManagerId=b.Id
        and a.Salary>b.Salary;

1.employee的表出现了两次,分别命名为a,b,因为只有一个表要使用两次,为了避免二义性才用不同的名字
2.注意结果那里显示的列名是:Employee而原表是 Name

相关文章:

  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2021-12-27
  • 2021-08-11
  • 2021-06-27
猜你喜欢
  • 2021-06-09
  • 2022-12-23
  • 2021-10-19
  • 2021-11-16
  • 2021-08-24
  • 2021-10-23
相关资源
相似解决方案