NOT IN vs NOT EXISTS

前端 未结 11 1666
粉色の甜心
粉色の甜心 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:34

    They are very similar but not really the same.

    In terms of efficiency, I've found the left join is null statement more efficient (when an abundance of rows are to be selected that is)

提交回复
热议问题