insert into tab1(col1,col2)
select tab2.co1,tab2.co2 from tab2 where exists 
(select 'X' from tab3
 where tab2.co3 = tab3.co3)