Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
JAnstee (WMF)
.
Toggle Highlighting
SQL
#-----PAGE EDITORS #-----PAGE EDITORS #unique editors to the Page annually SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, EXTRACT(Month from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `month`, COUNT(distinct rev_user) AS editors FROM nowiki_p.revision r INNER JOIN nowiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_title IN ("Tinget") AND p.page_namespace=4 AND r.rev_timestamp > 20100701000000 AND r.rev_timestamp < 20150630000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM nowiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot GROUP BY `year` ORDER BY `year` ASC; #unique editors to the Page monthly SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, EXTRACT(Month from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `month`, COUNT(distinct rev_user) AS editors FROM nowiki_p.revision r INNER JOIN nowiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_title IN ("Tinget") AND p.page_namespace=4 AND r.rev_timestamp > 20130701000000 AND r.rev_timestamp < 20150630000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM nowiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #edits to the Page annual SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, EXTRACT(Month from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `month`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN nowiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_title IN ("Tinget") AND p.page_namespace=4 AND r.rev_timestamp > 20100101000000 AND r.rev_timestamp < 20150630000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot GROUP BY `year` ORDER BY `year` ASC; #edits to the Page monthly SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, EXTRACT(Month from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `month`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN nowiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_title IN ("Tinget") AND p.page_namespace=4 AND r.rev_timestamp > 20130701000000 AND r.rev_timestamp < 20150630000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC;
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...