Service Desk SQL question
Hi all, I'm trying to add an additional field to the following SQL query to add custom5 in the results. This is a pull down for the number of devices that the request is for. Thanks in advance!
SELECT IFNULL(O.FULL_NAME,'Unassigned') AS 'Owner', COUNT(T.ID) AS '# of Tickets' FROM HD_TICKET T
JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID)
LEFT JOIN USER O ON (T.OWNER_ID = O.ID)
WHERE (S.STATE = 'closed' AND DATEDIFF(NOW(), T.TIME_CLOSED) < 365)
GROUP BY O.FULL_NAME
order by COUNT(T.ID) DESC