0
SELECT LEFT(invoice_date, 10) as fix_date, 
       COUNT(*) as countOrders, 
       SUM((SELECT SUM(od.product_quantity) FROM ps_order_detail od WHERE o.id_order = od.id_order)) as countProducts, 
       SUM(o.total_paid_tax_excl / o.conversion_rate) as totalSales 
FROM ps_orders o 
WHERE o.valid = 1 
AND  od.id_warehouse = 5
AND o.invoice_date BETWEEN '2022-09-01 00:00:00' AND '2022-09-30 23:59:59' 
AND o.id_shop IN (1) 
GROUP BY LEFT(invoice_date, 10)

I want to connect between table order and order_detail by left join but when I add left join occur an error in the title what solution? I want to connect between table order and order_detail by left join but when I add left join occur an error in the title what solution?

I want to connect between table order and order_detail by left join but when I add left join occur an error in the title what solution?

4
  • I want to connect between table order and order_detail by left join but when I add left join occur an error in the title what solution? Sep 27, 2022 at 13:24
  • Help me write this query in SQL. Please read the link and update the question. There is no od.id_warehouse because you should join with ps_order_detail FROM ps_orders o LEFT JOIN ps_order_detail .... Sep 27, 2022 at 13:31
  • thank s my dear this syntax is one stament Sep 27, 2022 at 13:41
  • and id_warehouse column in ps_order_detail Sep 27, 2022 at 13:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.