Here is my query that I got from a very nice fellow on here, now the manager wants to add a restriction for tickets who's priority is 5.  


SELECT U.FULL_NAME AS SUBMITTER, COUNT(T.ID) AS TOTAL,

GROUP_CONCAT(CAST(T.ID AS CHAR) ORDER BY 1 SEPARATOR ', ') AS TICKETS
FROM HD_TICKET T
JOIN USER U ON (U.ID = T.SUBMITTER_ID)
JOIN HD_STATUS S ON (S.ID = T.HD_STATUS_ID)
WHERE NOW() > DATE_ADD(T.CREATED,INTERVAL 3 DAY)
AND DAYOFWEEK(T.CREATED) NOT IN (1,7)
AND S.STATE = 'opened'
GROUP BY U.FULL_NAME
ORDER BY U.FULL_NAME

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

1

Please see my reply to the original question.

John

Answered 01/14/2013 by: jverbosk
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity