NOT IN vs NOT EXISTS

前端 未结 11 1530
粉色の甜心
粉色の甜心 2020-11-21 12:08

Which of these queries is the faster?

NOT EXISTS:

SELECT ProductID, ProductName 
FROM Northwind..Products p
WHERE NOT EXISTS (
    SELECT 1 
    FROM         


        
11条回答
  •  情深已故
    2020-11-21 12:47

    If the optimizer says they are the same then consider the human factor. I prefer to see NOT EXISTS :)

提交回复
热议问题