I got a table for sales order and purchase order.
Sales order
Date Amount
26/10 120
26/10 130
26/10 50
27/10 50
27/10 60
Purchase Order
Date Amount
26/10 200
26/10 300
26/10 100
27/10 100
27/10 100
I want to display the total sales and total purchase by date.
E.g.
Date Total Sales Total Purchases
26/10 300 600
27/10 110 200
My SQL query is like this but it doesnt work.
$query = "Select o.date, o.Amount AS Sales, p.date, p.Amount AS Purchases
From customerorder o
right join Purchaseorder p on o.date = p.date
order by o.date";
Please help! Thanks!
MySQL doesn’t support FULL JOIN, so specifically for MySQL, you can use