I have like this table
MySQL> select * from order;
+-----+-------------+---------------+
| id | order_total | payment_date |
+-----+-------------+---------------+
| 1 | 35 | 2015-05-17 |
| 2 | 35 | 2015-03-17 |
| 3 | 65 | 2015-02-04 |
| 4 | 39 | 2015-01-01 |
| 5 | 19 | 2015-01-21 |
| 6 | 27 | 2015-10-21 |
| 7 | 74 | 2015-02-15 |
| 8 | 81 | 2015-09-13 |
| 9 | 86 | 2015-03-01 |
| 10 | 42 | 2015-07-08 |
| 11 | 73 | 2015-05-19 |
| 12 | 78 | 2015-07-20 |
| 13 | 92 | 2015-02-04 |
......
|1913 | 71 | 2015-11-04 |
+-----+-------------+---------------+
I need the result to show me each month payment for year 2015 I try to use
SELECT MONTHNAME(payment_date),
SUM(order_total)
FROM order
GROUP BY YEAR(payment_date),
MONTH(payment_date)
but its not giving the zero months I read this question also but he have tow table I need the result to show me each month payment with total like this
+-----+-------+
| MM | Total |
+-----+-------+
| 01 | 5735 |
| 02 | 2535 |
| 03 | 1065 |
| 04 | 0 |
| 05 | 919 |
| 06 | 0 |
| 07 | 2874 |
| 08 | 0 |
| 09 | 6086 |
| 10 | 2042 |
| 11 | 1973 |
| 12 | 0 |
+-----+-------+