Forums / General Questions / SQL help to create a report of customers who purchased a specific product....

SQL help to create a report of customers who purchased a specific product....

Locked

Started by friends1976 on 3 Dec 2009, 7:59 PM · Views: 1,487

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
3 Dec 2009, 7:59 PM
#1
friends1976 avatar

friends1976

Zen Follower

Join Date:
Dec 2006
Posts:
198
Plugin Contributions:
0

SQL help to create a report of customers who purchased a specific product....

I need to create a report that contains the contact information of the customers in our store that have purchased one specific product. Is there a way to create a SQL statement to get this information? Can anyone offer any help with regard to this? I did try the sales report add on but it only gave you the totals per product and that sort of thing....not the customer details.

Thank you in advance for any help you can offer.

3 Dec 2009, 9:21 PM
#2
data_digger avatar

data_digger

Zen Follower

Join Date:
Jan 2009
Posts:
222
Plugin Contributions:
2

Re: SQL help to create a report of customers who purchased a specific product....

SELECT DISTINCT c.*
FROM customers c, orders o, orders_products op
WHERE c.customers_id = o.customers_id
AND o.orders_id = op.orders_id
AND op.products_id = YOUR_PRODUCT_ID