SELECT ct.NAME "Template",
Count(chdt.changeid) "count" FROM changedetails chdt
LEFT JOIN changetemplate ct
ON chdt.templateid=ct.templateid
WHERE chdt.createdtime >= <from_lastmonth>
AND chdt.createdtime <= <to_lastmonth>
GROUP BY ct.NAME
ORDER BY 1