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
Pushakiran
.
Compare each top editor's total edits against the overall average: How much more than average as percentage
Toggle Highlighting
SQL
#CTE (Common Table Expression) for total edits made by editors across a rolling 3-month period. WITH TotalEdits AS ( SELECT actor_id AS editor_id, actor_name AS editor_name, COUNT(DISTINCT rev_id) AS total_edits FROM revision JOIN actor ON rev_actor = actor_id WHERE rev_timestamp >= DATE_FORMAT(DATE_SUB(CURRENT_DATE(), INTERVAL 2 MONTH), '%Y%m%01000000') GROUP BY actor_id,actor_name ) SELECT editor_id, editor_name, total_edits, ((total_edits - AVG(total_edits))/ AVG(total_edits))*100 AS percent_more_than_average FROM TotalEdits 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...