Created
April 24, 2012 06:41
-
-
Save tagomoris/2477159 to your computer and use it in GitHub Desktop.
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 | |
| date, | |
| category, | |
| COUNT(*) AS c1 | |
| FROM ( | |
| SELECT date, parse_agent(agent)['category'] AS category | |
| FROM access_logs | |
| WHERE service='blog' | |
| AND (date='20120424' OR date='20120423') | |
| ) x | |
| WHERE category='smartphone' | |
| GROUP BY date,category | |
| ORDER BY date,c1 DESC | |
| LIMIT 10 |
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 | |
| date, | |
| parse_agent(agent)['category'], | |
| COUNT(*) AS c1 | |
| FROM access_logs | |
| WHERE service='blog' | |
| AND (date='20120424' OR date='20120423') | |
| AND parse_agent(agent)['category']='smartphone' | |
| GROUP BY date,parse_agent(agent)['category'] | |
| ORDER BY date,c1 DESC | |
| LIMIT 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment