已知Employee表如下:
示例如下:
*此题考查SQL语句的查询写法。*有下面两种解法:
1.并链接
# Write your MySQL query statement below
select Employee1.name as Employee
from Employee Employee1,Employee Employee2
where Employee1.salary>Employee2.salary and Employee2.id=Employee1.managerId
2.套链接
# Write your MySQL query statement below
select Employee1.name as Employee
from Employee Employee1
where Employee1.salary>(select Employee2.salary from Employee Employee2 where Employee2.id=Employee1.managerId)