Mysql question: is there something like IN ALL query?
- by jaycode
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?