Created
July 14, 2015 21:55
-
-
Save milimetric/fc95d765bdeb9708bde4 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, project, variant, page_title, | |
rank() over (PARTITION by date, project, variant ORDER BY tmp.pageviews desc) as rank | |
(select concat(year, lpad(month, 2, '0'), lpad(day, 2, '0')) as date, | |
project, | |
variant, | |
page_title, | |
sum(view_count) as pageviews | |
from wmf.pageview_hourly | |
where year = 2015 | |
and month = 7 | |
and day = 1 | |
and agent_type = 'user' | |
and page_title != '-' | |
and project = 'etwiki' | |
group by year, month, day, project, variant, page_title | |
) tmp | |
where rank <= 1000 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment