I am working in MS Access 2013 with these two tables.
t1: t2:
ID ID F1 F2
1 a a
2 1 b a
3 2 b a
I know it is not the most ideal way to do this, but I wrote this query to pull all IDs that dont exist in another table.
Select [ID] from table1 WHERE [ID] NOT IN (SELECT ID FROM table2)
The query should return 3, but for some reason this table gives me no results. When I change the query to this, it gives me 3 as the result.
Select [ID] from table1 WHERE [ID] NOT IN (SELECT [ID] FROM table2 WHERE [ID] IS NOT NULL)
I am unsure to why the logic of why the second query works, but the first one returns no results. When I run the nested query (SELECT [ID] FROM table2) it does not return 3 for either query, so both queries should work. Can anyone explain why the first query does not return anything?