>I have a collegue who wants to do a SQL select statement in ACCESS where he wants to have all the records from one table that doesn't have any matches from another table. (In logic, we refer that as the difference sometime : (A / B) = All A which are not in B) He said that with an Oracle server, it would be select... from A intersect B, but I can say if it's true or not. Does anybody know the correct syntax for a SQL server 2000 database?
SELECT * FROM table1
WHERE NOT EXISTS (SELECT * FROM table2 WHERE table2.keyfield = table2.keyfield)
SELECT * FROM table1
WHERE keyfield NOT IN (SELECT keyfield FROM table2)
My guess is that execution plan would be the same for both queries.
--sb--