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