Last active
October 28, 2018 06:28
-
-
Save thedarsideofit/40b5582530aa9c8ce3fc09abbcf03c0d to your computer and use it in GitHub Desktop.
prestashop-customers-orders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT `id_customer`,`id_gender`, `birthday`, `newsletter`, `optin`, `date_add`, `date_upd`, | |
(SELECT count(id_order) | |
FROM `ps_orders` inner join ps_order_state on ps_orders.current_state = ps_order_state.id_order_state | |
WHERE ps_orders.id_customer = ps_customer.id_customer and ps_order_state.paid = 1) orders | |
FROM `ps_customer` | |
WHERE 1 | |
ORDER BY orders DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment