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
WITH total_edits AS ( SELECT rev_actor, COUNT(rev_id) AS edit_count FROM revision WHERE rev_timestamp >= DATE_SUB(CURRENT_DATE, INTERVAL 3 MONTH) GROUP BY rev_actor ), overall_average AS ( SELECT ROUND(AVG(edit_count), 0) AS avg_edits FROM total_edits ) SELECT te.rev_actor, concat(ROUND(((te.edit_count - oa.avg_edits) / oa.avg_edits) * 100, 0), '%') AS percentage_above_average FROM total_edits te, overall_average oa WHERE te.edit_count >= oa.avg_edits ORDER BY te.edit_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...