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
Yesh0305
.
Toggle Highlighting
SQL
SET @avg_edits = ( SELECT AVG(totaledits) AS avg_edit FROM ( SELECT r.rev_actor AS actor_id, a.actor_name, COUNT(r.rev_id) AS totaledits FROM revision r JOIN actor a ON r.rev_actor = a.actor_id WHERE r.rev_timestamp BETWEEN DATE_FORMAT(CURDATE() - INTERVAL 2 MONTH, '%Y-%m-01') AND LAST_DAY(CURDATE()) -- Get the last day of the current month GROUP BY r.rev_actor ) AS new ); SELECT a.actor_name, COUNT(r.rev_id) AS total_edits, ROUND(((COUNT(r.rev_id) - @avg_edits) / @avg_edits) * 100, 2) AS percentage_above_avg FROM revision r JOIN actor a ON r.rev_actor = a.actor_id WHERE r.rev_timestamp BETWEEN DATE_FORMAT(CURDATE() - INTERVAL 2 MONTH, '%Y-%m-01') AND LAST_DAY(CURDATE()) -- Get the last day of the current month GROUP BY a.actor_name ORDER BY total_edits 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...