I\'m having trouble coming up with a query that will find all customers who have purchased both PROD1 and PROD2.
Here\'s a pseudo-query that kind of looks like what
This is an Access answer based on the infamous Northwind sample db. You should be abe to translate that in mySql quite easily.
SELECT o.CustomerID, Sum([ProductID]='Prod1') AS Expr1, Sum([productid]='Prod1') AS Expr2
FROM Orders AS o INNER JOIN [Order Details] AS d ON o.OrderID = d.OrderID
GROUP BY o.CustomerID
HAVING (((Sum([ProductID]='Prod1'))<>0) AND ((Sum([productid]='Prod1'))<>0));