不足している月については、すべての月でユニオンクエリを実行し、テーブルに参加できます
SELECT
t1.`year`,
t.`month`,
coalesce(t1.payment,0) payment
FROM
(SELECT 1 AS `month`
UNION
SELECT 2 AS `month`
UNION
....
SELECT 12 AS `month`
) AS t
LEFT JOIN your_table t1 on(t.`month` = t1.`month`)
WHERE ....