What is the difference between  All and Not In Could you please tell me the differences between

select CustomerId from Customer Where TerritoryId &lt;&gt; All(select TerritoryId from Salesperson)

select CustomerId from Customer where TerritoryId NOT IN (select TerritoryId from Salesperson)
There is no difference in result but there is a bit different semantics. 

X [comparison] ALL(set) mean that set is empty or the comparison is TRUE for each entry in the set.

X NOT IN (set) means that X does not belong to the set.

While [comparison] is "not equal", both forms are equivalent. But for other comparisons it may be different.