select year(event.dtr) dtr,month(event.dtr) mnth, monthname(dtr) mnthnm, event.type tp, sum(event.summ) sm, type.name nm, type.color cl
from event
left JOIN type on type.id = event.type
where event.type in (1,2,3,4)
group by mnth, tp
ORDER BY dtr, mnth, tp;