This is my sample query
Select table1.id from table1 where table.id in (select table2.id from table2 where table2.