I have table like this,
SELECT
payment_id,amount,payment_date
FROM payment
To get the monthly total amount, i wrote query as
SELECT
payment_id
, SUM(amount) AS Total
, MonthName(payment_date) AS Month
FROM payment
But I am getting wrong answer in the amount table as all the values are getting added to the same month.
payment_id amount payment_date
1 19.00 May
It would be grateful for me if somebody can help me out in this?