Jump to content

RE: How to find all customers who bought a specific product


Recommended Posts

In response to this thread: https://www.prestashop.com/forums/topic/324997-solved-how-to-find-all-customers-who-bought-a-specific-product/

 

I'm trying to execute this on SQL Manager and I get:

 

The "id_customerINNER" attribute does not exist in the "ps_orders" table.

 

CODE:

 

SELECT C.email FROM ps_customer C
INNER JOIN ps_orders O on C
.id_customer = O.id_customer
INNER JOIN ps_order_detail OD on O
.id_order = OD.id_order
WHERE OD
.product_id IN (3,45,47,94,102)

 

OR

 

SELECT C.email FROM ps_customer C 

INNER JOIN ps_orders O on C.id_customer = O.id_customer
INNER JOIN ps_order_detail OD on O
.id_order = OD.id_order
WHERE OD
.product_id =3

 

Even with changing the last line of each code statements.

 

How can I resolve this?

 

Thanks

Edited by kieranbold (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...