I have simple query
SELECT * FROM `month` LEFT JOIN income ON month.idmonth = income.idmonth
I want to display income every month this year, in every month there is only one income.
I have tried combining with
WHERE YEAR(`created_at`) = YEAR(CURDATE())
but this query only show 1 row
or remove this line:
WHERE YEAR(`created_at`) = YEAR(CURDATE())
table showing
| month | income |
| Januari | 13000 | //2018
| Januari | 14000 | //current year 2019
| Februari | NULL |
| maret | NULL |
| april | NULL |
| mei | NULL |
. . .
| Desember | NULL |
so this is what I want
| month | income |
| Januari | 14000 |
| Februari | NULL |
| maret | NULL |
| april | NULL |
| mei | NULL |
. . .
| Desember | NULL |