riteshuae Posted July 7, 2014 Share Posted July 7, 2014 Hi i have installed prestashop 1.4.8.2, i want report from mysql, Number of orders per customer with customer name & customer id plus i want total amount of order customer wise. can you help me with SQL query so i can generate this report from phpmyadmin. thanks, regards, Ritesh Link to comment Share on other sites More sharing options...
webdev0008 Posted July 7, 2014 Share Posted July 7, 2014 (edited) Hi use this select c.id_customer, c.firstname, c.lastname, count(o.id_order) as ordercnt from ps_customer c left join ps_orders o on c.id_customer = o.id_customer group by o.id_customer Edited July 7, 2014 by webdev0008 (see edit history) 3 Link to comment Share on other sites More sharing options...
riteshuae Posted July 7, 2014 Author Share Posted July 7, 2014 thanks a lot, its working fine. regards, Ritesh Link to comment Share on other sites More sharing options...
riteshuae Posted July 7, 2014 Author Share Posted July 7, 2014 thanks a lot, its working fine. regards, Ritesh Link to comment Share on other sites More sharing options...
Recommended Posts