Du bruger en LEFT JOIN
, men i din where-erklæring gør du det til en 'normal' JOIN
Prøv at skrive det sådan her:
SELECT months_tbl.month, COUNT( events_tbl.appt_id ) cnt
FROM months_tbl
LEFT JOIN events_tbl ON (months_tbl.month_id = MONTH(events_tbl.appt_date_time)
AND events_tbl.company_id = 1
)
GROUP BY months_tbl.month
ORDER BY months_tbl.month_id ASC;
Bemærk AND events_tbl.company_id = 1
er i LEFT JOIN