Created
December 21, 2017 20:29
-
-
Save reneeb/dab6e555b0bcd3c0385460673194950c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT count( a.ticket_id ), t.name | |
FROM article a | |
INNER JOIN article_type t | |
ON a.article_type_id = t.id | |
INNER JOIN article_sender_type st | |
ON a.article_sender_type_id = st.id | |
WHERE a.id = ( | |
SELECT MIN(id) | |
FROM article a2 | |
WHERE a2.ticket_id = a.ticket_id | |
) | |
AND a.create_time BETWEEN '2017-12-21 15:00:00' AND '2017-12-21 21:00:00' | |
GROUP BY a.article_type_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment