b1nary0mega
6/9/2015 - 6:54 PM

Get a count using rollup of the number of requests by type for each unit from the feedback table

Get a count using rollup of the number of requests by type for each unit from the feedback table

SELECT A.unit_id,
  A.ENTRY_TYPE,
  COUNT(*) AS REQUESTS
FROM USER_FEEDBACK A
WHERE A.ENTRY_DATE >= SYSDATE - 365
AND LOWER(A.RECIPIENT) LIKE '%ADD_HELPDESK_EMAIL_HERE%'
GROUP BY ROLLUP(A.UNIT_ID, A.ENTRY_TYPE)
ORDER BY A.UNIT_ID,
  REQUESTS DESC,
  A.ENTRY_TYPE;