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
Blahma
.
Bots excluded. When forking, please adapt wiki and dates at the top.
Toggle Highlighting
SQL
use huwiki_p; set @begin = '20150101000000', @end = '20160101000000'; select date, count(*) as edits from ( select date(date_add(rev_timestamp, interval 2 hour)) as date from revision left join user_groups on rev_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(date_sub(@begin, interval 2 hour), interval 6 day) and 0+date_sub(date_sub(@end, interval 2 hour), interval 1 second) union all select date_add(date(date_add(rev_timestamp, interval 2 hour)), interval 1 day) as date from revision left join user_groups on rev_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(date_sub(@begin, interval 2 hour), interval 6 day) and 0+date_sub(date_sub(@end, interval 2 hour), interval 1 second) union all select date_add(date(date_add(rev_timestamp, interval 2 hour)), interval 2 day) as date from revision left join user_groups on rev_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(date_sub(@begin, interval 2 hour), interval 6 day) and 0+date_sub(date_sub(@end, interval 2 hour), interval 1 second) union all select date_add(date(date_add(rev_timestamp, interval 2 hour)), interval 3 day) as date from revision left join user_groups on rev_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(date_sub(@begin, interval 2 hour), interval 6 day) and 0+date_sub(date_sub(@end, interval 2 hour), interval 1 second) union all select date_add(date(date_add(rev_timestamp, interval 2 hour)), interval 4 day) as date from revision left join user_groups on rev_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(date_sub(@begin, interval 2 hour), interval 6 day) and 0+date_sub(date_sub(@end, interval 2 hour), interval 1 second) union all select date_add(date(date_add(rev_timestamp, interval 2 hour)), interval 5 day) as date from revision left join user_groups on rev_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(date_sub(@begin, interval 2 hour), interval 6 day) and 0+date_sub(date_sub(@end, interval 2 hour), interval 1 second) union all select date_add(date(date_add(rev_timestamp, interval 2 hour)), interval 6 day) as date from revision left join user_groups on rev_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(date_sub(@begin, interval 2 hour), interval 6 day) and 0+date_sub(date_sub(@end, interval 2 hour), interval 1 second) ) as aweek group by date having date between date(@begin) and date_sub(date(@end), interval 1 day) order by date;
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...