I have query, which shows last 12 month record, it is working fine for me, but i want to show that month also which have no records, if there is no records for the particular month then i want to show 0 records for that month, here i have added my query for that
SELECT `amount`, CONVERT_TZ(created, "+00:00", "-05:00") as created,
MONTHNAME(CONVERT_TZ(created, "+00:00", "-05:00")) as month,
`sponsorion_fees`, `processor_fees`, `amount_after_fees`,
SUM(amount_after_fees) as total FROM `transaction`
WHERE `record_owner_user_id` = '50' AND `is_one_time_purchase` = 'Y'
AND CONVERT_TZ(created,"+00:00","-05:00") <= "2018-11-26 07:08:24"
and CONVERT_TZ(created,"+00:00","-05:00") >=
Date_add("2018-11-26 07:08:24",interval - 12 month)
GROUP BY `month` ORDER BY `id` ASC
Can anyone please help me how can i resolve this issue ?