SQL: … WHERE X IN (SELECT Y FROM …)

后端 未结 5 897
Happy的楠姐
Happy的楠姐 2021-02-12 11:30

Is the following the most efficient in SQL to achieve its result:

SELECT * 
  FROM Customers 
 WHERE Customer_ID NOT IN (SELECT Cust_ID FROM SUBSCRIBERS)
         


        
5条回答
  •  广开言路
    2021-02-12 12:11

    Any mature enough SQL database should be able to execute that just as effectively as the equivalent JOIN. Use whatever is more readable to you.

提交回复
热议问题