I get more results with this query:
SELECT * FROM table1
WHERE NOT EXISTS (
SELECT table2.id FROM table2
WHERE table1.id = table2.id
)
Than from this query:
SELECT * FROM table1
WHERE table1.id NOT IN (
SELECT table2.id FROM table2
)
Why is this? I thought they were identical?
By the way, table2
has some NULL values in the id
field.