Last active
November 2, 2015 21:56
-
-
Save pablotron/fed2481185a2d2edbaf1 to your computer and use it in GitHub Desktop.
example query
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 a.month, | |
product_id, | |
COUNT(*) AS num_tickets | |
FROM ( | |
SELECT to_char(create_date, 'Mon') AS month, | |
product_id | |
FROM tickets | |
) a | |
GROUP BY a.month, a.product_id | |
ORDER BY a.month, a.product_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment