Tente isto: SELECT item_id FROM recipes_ingredients_items WHERE id IN (71, 2, 22) GROUP BY item_id HAVING COUNT(*) = 3