kieranbold Posted August 9, 2015 Share Posted August 9, 2015 (edited) 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 CINNER JOIN ps_orders O on C.id_customer = O.id_customerINNER JOIN ps_order_detail OD on O.id_order = OD.id_orderWHERE 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_customerINNER JOIN ps_order_detail OD on O.id_order = OD.id_orderWHERE OD.product_id =3 Even with changing the last line of each code statements. How can I resolve this? Thanks Edited August 10, 2015 by kieranbold (see edit history) Link to comment Share on other sites More sharing options...
kieranbold Posted August 10, 2015 Author Share Posted August 10, 2015 Any update on how to solve this please? Thank you Link to comment Share on other sites More sharing options...
madj Posted April 1, 2017 Share Posted April 1, 2017 Hi kieranbold, I use this and it works. Problem of parenthesis !! SELECT * FROM ps_customer cINNER JOIN ps_orders o ON (c.id_customer=o.id_customer)INNER JOIN ps_order_detail od ON(od.id_order=o.id_order)WHERE od.product_id=100 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now