I've tried it and succeeded. Thanks for the help Mr. Misra.
Best regards,
Haidarpesebe
.
- Original Message -
From: "Aveek Misra"
To: "HaidarPesebe"
Cc: "MySQL Lists"
Sent: Monday, June 20, 2011 11:28 AM
Subject: Re: calculate the total amount
SELECT CONCAT(b.month, '-', b.year) AS Date, SUM(b.quantity * a.price) AS Total
FROM items AS a, orders AS b WHERE a.code = b.code GROUP BY month, year;
where "items" is "Table A" and "orders" is "Table B"
Thanks
Aveek
On Jun 20, 2011, at 9:27 AM, HaidarPesebe wrote:
> Please help us calculate