Re: calculate the total amount of revenue each month-year

2011-06-19 Thread HaidarPesebe
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

Re: calculate the total amount of revenue each month-year

2011-06-19 Thread Aveek Misra
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