8
82033chn
Suppose I have a customer_order table where customer's order details
are stored, e.g., Customer I ordered Product A, B, C on day 1, and
Customer II ordered Product B, C, F, G on day 2, and so on.
I could not figure out an "easy" way which a single query can be
designed so I know which customers ordered Product B and C at the same
time, other than doing it awkardly by:
SELECT DISTINCT customer_order.CustomerID, customer_order.Product,
customer_order_1.Product
FROM customer_order INNER JOIN customer_order AS customer_order_1 ON
customer_order.Product = customer_order.Product
WHERE (((customer_order.Product)="B") AND
((customer_order_1.Product)="C"));
What if I need to know the customers who ordered seven products with a
single order? I hate to design a query where the table is linked 7
times! Surely there is a simpler way? Appreciate any help. Thanks.
Please email to (e-mail address removed).
are stored, e.g., Customer I ordered Product A, B, C on day 1, and
Customer II ordered Product B, C, F, G on day 2, and so on.
I could not figure out an "easy" way which a single query can be
designed so I know which customers ordered Product B and C at the same
time, other than doing it awkardly by:
SELECT DISTINCT customer_order.CustomerID, customer_order.Product,
customer_order_1.Product
FROM customer_order INNER JOIN customer_order AS customer_order_1 ON
customer_order.Product = customer_order.Product
WHERE (((customer_order.Product)="B") AND
((customer_order_1.Product)="C"));
What if I need to know the customers who ordered seven products with a
single order? I hate to design a query where the table is linked 7
times! Surely there is a simpler way? Appreciate any help. Thanks.
Please email to (e-mail address removed).