mysql "IN" condition with subquery -


i need execute following:

select * mp_sizes  size_id in(select size_ids mp_size_categories  category_id = '3' , sub_category_id = '5'); 

when run below query return me 3 records.

select * mp_sizes size_id in(3,2,4); 

also when run sub query showing me correct result.

select size_ids mp_size_categories  category_id = '3' , sub_category_id = '5'; 

the above query gives result 3, 2, 4.

but when use in sub query returns 1 record. return size details of first value (3) only.

how can results of 3 sizes (3, 2, 4)?

have tried using join? (which faster)

 select * mp_sizes, mp_size_categories  size_id = size_ids , category_id = '3'  , sub_category_id = '5'; 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -