How to find if a list/set is contained within another list
问题 I have a list of product IDs and I want to find out which orders contain all those products. Orders table is structured like this: order_id | product_id ---------------------- 1 | 222 1 | 555 2 | 333 Obviously I can do it with some looping in PHP but I was wondering if there is an elegant way to do it purely in mysql. My ideal fantasy query would be something like: SELECT order_id FROM orders WHERE (222,555) IN GROUP_CONCAT(product_id) GROUP BY order_id Is there any hope or should I go read