Hi, I have a table ORDER_PRODUCT with fields ORDER_ID, PRODUCT_ID, PRODUCT_QUANTITY, PRODUCT_PRICE... and a table ORDER with fields ORDER_ID, CUSTOMER_ID... How do I write the mysql to show how many customers order each product and how many each item were sold? (Same customer can order the same item as many times as they want just like we can go to store to buy the same bread every week. So same customer will count 1.) Thanks for any help in advance.
you can use distinct() to choose only distinct customers. And count() will give the number of rows. If you send me the actual structure with dump data ill give u the actual queries