Jump to content

Edit History

JulienPct

JulienPct

J'en avais une autre, à la place de join sur id_customer, tu devrais joindre sur o.id_address_invoice et a.id_address

 

SELECT
cl.`name` AS `PAYS`,
COUNT(o.`id_order`) AS `Nombre_total_cmde`,
ROUND(SUM(o.`total_paid_tax_excl`), 2) AS `CA_HT`
FROM `ps_orders` o
LEFT JOIN ps_address a ON o.`id_address_invoice` = a.`id_address`
LEFT JOIN ps_country_lang cl ON cl.`id_country` = a.`id_country`
WHERE  o.`date_add` >= '2021-09-01 0:0:0' AND o.`date_add` <= '2021-09-30 23:59:59'
AND o.`current_state` IN (2, 3, 4 ,5, 9, 25, 26, 20, 31, 32, 33)
AND o.`module` IN ('paypal')
GROUP BY a.`id_country`

 

JulienPct

JulienPct

J'en avais une autre, à la place de join sur id_customer, tu devrais joindre sur o.id_address_invoice et a.id_address

 

SELECT
cl.`name` AS `PAYS`,
COUNT(o.`id_order`) AS `Nombre_total_cmde`,
ROUND(SUM(o.`total_paid_tax_excl`), 2) AS `CA_HT`
FROM `ps_orders` o
LEFT JOIN ps_address a ON o.`id_address_invoice` = a.`id_address`
LEFT JOIN ps_country_lang cl ON cl.`id_country` = a.`id_country`
WHERE  o.`date_add` >= '2021-09-01 0:0:0' AND o.`date_add` <= '2021-09-30 23:59:59'
AND o.`current_state` IN (2, 3, 4 ,5, 9, 25, 26, 20, 31, 32, 33)
AND o.`module` IN ('paypal')
GROUP BY a.`id_country`

 

JulienPct

JulienPct

J'en avais une autre, à la place de join sur id_customer, tu devrais joindre sur o.id_address_invoice et a.id_address

 

SELECT cl.`name` AS `PAYS`, COUNT(o.`id_order`) AS `Nombre_total_cmde`, ROUND(SUM(o.`total_paid_tax_excl`), 2) AS `CA_HT` FROM `ps_orders` o LEFT JOIN ps_address a ON o.`id_customer` = a.`id_customer` LEFT JOIN ps_country_lang cl ON cl.`id_country` = a.`id_country` WHERE o.`date_add` >= '2021-09-01 0:0:0' AND o.`date_add` <= '2021-09-30 23:59:59' AND o.`current_state` IN (2, 3, 4 ,5, 9, 25, 26, 20, 31, 32, 33) AND o.`module` IN ('paypal') AND cl.`id_lang` = 1 GROUP BY a.`id_country`

SELECT
cl.`name` AS `PAYS`,
COUNT(o.`id_order`) AS `Nombre_total_cmde`,
ROUND(SUM(o.`total_paid_tax_excl`), 2) AS `CA_HT`
FROM `ps_orders` o
LEFT JOIN ps_address a ON o.`id_address_invoice` = a.`id_address`
LEFT JOIN ps_country_lang cl ON cl.`id_country` = a.`id_country`
WHERE  o.`date_add` >= '2021-09-01 0:0:0' AND o.`date_add` <= '2021-09-30 23:59:59'
AND o.`current_state` IN (2, 3, 4 ,5, 9, 25, 26, 20, 31, 32, 33)
AND o.`module` IN ('paypal')
GROUP BY a.`id_country`

 

JulienPct

JulienPct

J'en avais une autre, à la place de join sur id_customer, tu devrais joindre sur o.id_address_invoice et a.id_address

JulienPct

JulienPct

J'en avais une autre, à la place de join sur id_customer, tu devrais joindre sur o.id_address_invoice et a.id_address_invoice

×
×
  • Create New...