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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -