Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
AP districts improvement in enwiki - current month
by
Arjunaraoc
This query is marked as a draft
This query has been published
by
Arjunaraoc
.
AP districts pages , group by each article, with edits and editor count
Toggle Highlighting
SQL
SET @cdate=CURDATE() SET @cyear=LEFT(@cdate,4) SET @cmonth=MID(@cdate,6,2) SET @pmonth=IF (@cmonth=1, 12,@cmonth-1) SET @pyear=IF (@pmonth=12,@cyear-1,@cyear) SET @pmonthbegin=CONCAT(@pyear,@pmonth,"01") SET @cmonthbegin=CONCAT(@cyear,@cmonth+1,"01") SELECT subqres.page_title, COUNT(subqres.user_name) as count_editors, SUM(subqres.Edits) as tot_edit, @pmonthbegin, @cmonthbegin FROM (SELECT page_title, user_name, COUNT(*) as Edits FROM page JOIN categorylinks ON cl_from = page_id AND cl_to="Districts_of_Andhra_Pradesh" AND cl_type="page" JOIN revision ON page_id = rev_page JOIN actor ON rev_actor = actor_id JOIN user ON user_id =actor_user where rev_actor != 0 AND page_namespace=0 AND LEFT(rev_timestamp,8) >= @pmonthbegin AND LEFT(rev_timestamp,8) < @cmonthbegin AND NOT (user_name LIKE '%AWB%' OR user_name LIKE '%Bot%' OR user_name LIKE'%bot%' OR user_name LIKE '%BOT%' OR user_name ='CommonsDelinker') GROUP BY page_title,user_name) AS subqres GROUP BY subqres.page_title ORDER BY count_editors DESC, page_title ASC LIMIT 100;
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...