USE AdventureWorks2016; GO SELECT Bonus FROM Sales.SalesPerson WHERE BusinessEntityID = 285; GO
结果为 0.00(Syed Abbas没有收到奖金,因为他不是销售人员),因此外部查询计算为:
USE AdventureWorks2016; GO SELECT LastName, FirstName FROM Person.Person AS c JOIN HumanResources.Employee AS e ON e.BusinessEntityID = c.BusinessEntityID WHERE 5000 IN (0.00); GO
因为这是 false,Syed Abbas的行不包含在具有相关子查询的先前示例查询的结果中。 对Pamela Ansman-Wolfe行运行相同的过程。 你将看到此行包含在结果中,因为WHERE 5000 IN (5000)包含结果。