FROM 子句中的子查询
FROM
子句中的子查询的行为类似于在执行查询期间生成并在之后丢失的临时表。
SELECT Managers.Id, Employees.Salary
FROM (
SELECT Id
FROM Employees
WHERE ManagerId IS NULL
) AS Managers
JOIN Employees ON Managers.Id = Employees.Id
FROM
子句中的子查询的行为类似于在执行查询期间生成并在之后丢失的临时表。
SELECT Managers.Id, Employees.Salary
FROM (
SELECT Id
FROM Employees
WHERE ManagerId IS NULL
) AS Managers
JOIN Employees ON Managers.Id = Employees.Id