April 3, 2008 at 4:15 am
Adam Haines (4/2/2008)
This is similar and may in some cases work faster:
SELECT a.id
FROM tblA a
LEFT OUTER JOIN tblB b
ON b.id = a.id
WHERE b.id IS NULL
Yes it is. This is the method I usually use but I felt like posting some SQL 2005 exclusive code :).
You will also not that the left outer join is not always faster than using an in clause. As with most things, it depends.
Heh heh Oh yes...always test! ๐
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply