I am attempting to create a list of all orders that contain six specific products. The current query I'm using is:
SELECT o.order_date,
o.price AS revenue,
o.cost,
f.id AS fileid,
o.id AS orderid,
o.fk_order_status_id,
o.date_started,
o.date_completed,
p.description AS product,
pp.description AS subproduct
FROM orders o
JOIN file f
f.id = o.fk_file_id
JOIN product p
ON p.id = o.fk_product_id
JOIN product_product pp
ON pp.fk_product_id = o.fk_product_id
WHERE o.fk_product_id IN ('66','8','6','21','11')
Which pulls all orders that have ANY of those products. What I need to narrow down the results are orders that have those products altogether, not only one or two of the products. We are attempting to get counts of a Work Flow that we have recently implemented