I have been asked to create a query which will show the top 5 categories assigned to incidents with a given month? Is there a good way to do this?
You could create a query and group it by category.
Or you could do it in SQL:
SELECT COUNT(im_id) AS 'Number', IMINCA.im_full_name AS 'Incident Category'
FROM im_incident IMIN
INNER JOIN pm_process PMPR ON PMPR.pm_guid=IMIN.pm_guid
INNER JOIN im_incident_category IMINCA ON IMINCA.im_guid=IMIN.im_category_guid
WHERE PMPR.pm_creation_date between '2015-01-01' AND '2015-01-31'
GROUP BY IMINCA.im_full_name
ORDER BY 'Number' desc
Retrieving data ...