mysql - Select Additional Field from another Table -


i have following query,

this selects rows in table 1when type present in table2. there column in table2 named age want print.

select * table1  exists (select * table2 type = table1.type )  , color = 'blue'; 

any ideas ?

why don't try inner join ?

select table1.*,table2.age table1 inner join  table2 on table1.type=table2.type , table1.coloe='blue' 

you have written kind of recursive query, i'm not sure trying it. but, hit performance of query.


Comments