【Leetcode SQL】181: 超过经理收入的员工

这个题目在写的时候可以使用equal join,也就是将两个relation也就是两个table联系起来。最后输出的时候注意,column名应当为Employee而不是Name,需要再做一下as操作重命名。因此代码如下:

# Write your MySQL query statement below
select a.Name AS 'Employee'
from Employee a,Employee b
where a.ManagerId=b.Id and a.Salary> b.Salary
原文地址:https://www.cnblogs.com/geeksongs/p/15394999.html