Created
August 23, 2018 09:46
-
-
Save hipertracker/49ab9dcaacf40bd4152873586287712d to your computer and use it in GitHub Desktop.
SQL for Django
This file contains hidden or 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 SUM(pageview) AS pageview__sum, substring(url from '^/[^/]+/') AS category | |
| FROM portal_tracker | |
| GROUP BY substring(url from '^/[^/]+/') | |
| HAVING substring(url from '^/[^/]+/') IS NOT NULL | |
| ORDER BY pageview__sum DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment