Created
September 29, 2016 15:19
-
-
Save Hotfirenet/9f61b0ac64974c9f6769c300a9cf69ee to your computer and use it in GitHub Desktop.
requête sql pour Prestashop qui permet de remonter la quantité d'un produit vendu sur une période par client
This file contains 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 SUM(B.product_quantity) AS product_quantity | |
,C.id_customer | |
,C.company | |
FROM ps_orders A | |
INNER JOIN ps_order_detail B ON B.id_order = A.id_order | |
INNER JOIN ps_customer C ON C.id_customer = A.id_customer | |
WHERE B.product_id = 2734 AND CAST(A.date_add AS DATE) >= '2015-09-01' | |
GROUP BY C.id_customer, C.company | |
ORDER BY 1 DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment