select * from t1 where exists(select * from t2 where t1.code=t2.code) --where code = any (select code from t2) --where code in (select code from t2)