sql - Add a condition to a query from another table -
i have these tables: rome_sub(id_rome,id_sub)
, rome_holland(id_rome,id_holland)
what want make query like
select * rome_sub id_sub=x
and add condition:
id_holland in (y,z)
it seems looking exists or in clause:
select * rome_sub id_sub = 'x' , id_rome in ( select id_rome rome_holland id_holland in ('y','z') );
or:
select * rome_sub id_sub = 'x' , exists ( select * rome_holland id_holland in ('y','z') , rome_holland.id_rome = rome_sub.id_rome );
Comments
Post a Comment