SQL noob Question
I am trying to generate a very simple report with how many Critical, High, Medium, and Low tickets a person has using a sql query and just don't know enough about SQL to get what I want.
I want the output to be close to this:
Here is what I have:
SELECT HD_PRIORITY.NAME AS "Users's Tickets" FROM HD_TICKET JOIN HD_PRIORITY ON (HD_PRIORITY.ID = HD_TICKET.HD_PRIORITY_ID) JOIN HD_STATUS ON (HD_STATUS.ID = HD_TICKET.HD_STATUS_ID) LEFT JOIN USER O ON (O.ID = HD_TICKET.OWNER_ID) WHERE (HD_TICKET.HD_QUEUE_ID = 21) AND ((HD_STATUS.NAME not like '%Parked%') AND (HD_STATUS.NAME not like '%Closed%') AND (O.FULL_NAME = 'user')) GROUP BY HD_PRIORITY.NAME ORDER BY HD_PRIORITY.ORDINAL
The only thing I am missing is a second column with Count(*).
How do I do that? I feel like an idiot.
Thanks for helping me out.