这是一个虚拟查询,我想知道,md col查询(相关子查询)将仅执行5条记录或sales.customer表的所有记录。
SELECT CustomerID,
(SELECT TOP 1 Sales.SalesTerritory.ModifiedDate
FROM Sales.SalesTerritory
WHERE Sales.SalesTerritory.TerritoryID = Sales.Customer.TerritoryID) md
FROM Sales.Customer
ORDER BY CustomerID OFFSET 10 ROWS FETCH NEXT 5 ROWS ONLY
你真诚的
答案 0 :(得分:0)
都不是。它执行了15次。
(5 row(s) affected)
Table 'SalesTerritory'. Scan count 0, logical reads 30, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'Customer'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.