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
Pavan612
.
Toggle Highlighting
SQL
# sub query for calculation of average edits SET @avg_edits = (SELECT AVG(total_edits) FROM( SELECT COUNT(r.rev_id) AS total_edits FROM revision AS r WHERE r.rev_timestamp BETWEEN DATE_FORMAT(CURDATE()- INTERVAL 2 MONTH,'%Y%m01') AND DATE_FORMAT(CURDATE(),'%Y%m%d') GROUP BY r.rev_actor ) AS subquery); # main query SELECT a.actor_name, COUNT(r.rev_id) AS total_count,ROUND(((count(r.rev_id) - @avg_edits) / @avg_edits)*100,0) as percentage_above_Average FROM actor AS a JOIN revision AS r ON a.actor_id = r.rev_actor WHERE r.rev_timestamp BETWEEN DATE_FORMAT(CURDATE() - INTERVAL 2 MONTH, '%Y%m01') AND DATE_FORMAT(CURDATE(), '%Y%m%d') GROUP BY r.rev_actor order by total_count desc limit 5;
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...