Mysql question: is there something like IN ALL query?
Posted
by jaycode
on Stack Overflow
See other posts from Stack Overflow
or by jaycode
Published on 2010-04-30T17:01:58Z
Indexed on
2010/04/30
17:07 UTC
Read the original article
Hit count: 259
For example this query:
SELECT `variants`.* FROM `variants` INNER JOIN `variant_attributes` ON variant_attributes.variant_id = variants.id WHERE (variant_attributes.id IN ('2','5'))
And variant has_many variant_attributes
What I actually want to do is to find which variant has BOTH variant attributes with ID = 2 and 5. Is this possible with MySQL? Bonus Question, is there a quick way to do this with Ruby on Rails, perhaps with SearchLogic?
© Stack Overflow or respective owner