This code works perfectly! Is there anyway to export the customers first name along with their email?
Maybe something along these lines:
SELECT C.firstname, 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
EDIT: Just tested the above on my test server, and it executed perfectly.