I need a query that will give me the ID's in table 2 that are not in table 1. Yes I know this should be handled by key constraints, but it is not so I need to find the keys in table 2 that do not have a match in table 1. If I do a join I only get the records where the id's are equal.
1. select id from table2 where id not in (select id from table1 )
2. select id from table2 where not exists (select * from table1 where table1.id = table2.id)
3. select id from table2 except select id from table1
4. select distinct table2.id from table2 left outer join table1 on table1.id = table2.id where table1.id is null