Jump to content

Edit History

JulienPct

JulienPct

select  od.product_id as ProductID, od.product_quantity as Quantité,
		ppl.name as Nom,
        ppl.id_shop as Shop,
        pl.name as Pays,
		dc.amount as EcoParticipation
from ps_order_detail od
inner join ps_orders o on (o.id_order = od.id_order and o.invoice_date between '2021-11-16 00:00:00' and '2021-11-16 23:59:59')
inner join ps_product_lang ppl on (ppl.id_product = od.product_id and ppl.id_lang = 1 and ppl.id_shop = 1)
inner join ps_lang pl on pl.id_lang = ppl.id_lang
left join 
		(select od.product_id, sum(od.ecotax * od.product_quantity) as amount 
		from ps_order_detail od group by od.product_id) 
	dc on dc.product_id = od.product_id
where pl.iso_code = "fr"
group by od.product_id;

Normalement cette requête correspond aux besoins

JulienPct

JulienPct

select  od.product_id as ProductID, od.product_quantity as Quantité,
		ppl.name as Nom,
        ppl.id_shop as Shop,
        pl.name as Pays,
		dc.amount as EcoParticipation
from ps_order_detail od
inner join ps_orders o on (o.id_order = od.id_order and o.invoice_date between '2021-11-16 00:00:00' and '2021-11-16 23:59:59')
inner join ps_product_lang ppl on (ppl.id_product = od.product_id and ppl.id_lang = 1 and ppl.id_shop = 1)
inner join ps_lang pl on pl.id_lang = ppl.id_lang
left join 
		(select od.product_id, sum(od.ecotax * od.product_quantity) as amount 
		from ps_order_detail od group by od.product_id) 
	dc on dc.product_id = od.product_id
where pl.iso_code = "fr"
group by od.product_id;

Voila une réponse si quelqu'un se pose la même question

×
×
  • Create New...