Created
July 10, 2018 08:47
-
-
Save Hotfirenet/b7d981c448558fa53c89e9eed39647ef to your computer and use it in GitHub Desktop.
Cette requete permet de connaitre le nombre de produits vendus par client pour un Fabriquant / Marque sur Prestashop
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(OD.product_quantity) AS 'OD.product_quantity', | |
OD.product_name, | |
C.firstname, | |
C.lastname, | |
C.email | |
FROM ps_order_detail OD | |
INNER JOIN ps_product P ON P.id_product = OD.product_id | |
LEFT OUTER JOIN ps_orders O ON O.id_order = OD.id_order | |
LEFT OUTER JOIN ps_customer C ON C.id_customer = O.id_customer | |
WHERE P.id_manufacturer = 216 | |
GROUP BY OD.product_name, | |
C.firstname, | |
C.lastname, | |
C.email |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment