I have 2 tables (A and B) with the same primary keys. I want to select all row that are in A and not in B. The following works:
select * from A where not exi
This helped me a lot. Joins are always faster than Sub Queries to give results:
Joins
SELECT tbl1.id FROM tbl1 t1 LEFT OUTER JOIN tbl2 t2 ON t1.id = t2.id WHERE t1.id>=100 AND t2.id IS NULL ;