Skip to content

Instantly share code, notes, and snippets.

@milimetric
Created June 13, 2018 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milimetric/5f3b5a801576e4f86c2a52018f37e676 to your computer and use it in GitHub Desktop.
Save milimetric/5f3b5a801576e4f86c2a52018f37e676 to your computer and use it in GitHub Desktop.
history query example
with users_with_revisions as (
select event_user_id,
event_timestamp
from mediawiki_history
where event_entity = 'revision'
and event_type = 'create'
and snapshot = '2018-05'
and wiki_db = 'enwiki'
)
select event_user_id
from users_with_revisions x
where x.event_user_id in
(select event_user_id
from users_with_revisions
where event_timestamp >= '2016-11-01'
and event_timestamp < '2016-12-01'
group by event_user_id
)
and event_timestamp >= '2016-12-01'
and event_timestamp < '2018-06-01'
group by event_user_id
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment