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
WITH Edits_of_Rolling_Period AS ( SELECT u.user_id, u.user_name, r.rev_timestamp, SUM(user_editcount) AS Total_Edits FROM user u JOIN revision r ON u.user_id=r.rev_id WHERE r.rev_timestamp BETWEEN DATE_SUB(DATE_FORMAT(NOW(), '%Y-%m-01'), INTERVAL 2 MONTH) AND LAST_DAY(DATE_SUB(DATE_FORMAT(NOW(), '%Y-%m-01'), INTERVAL 0 MONTH)) GROUP BY user_id ), Ranked edits AS ( SELECT user_id, user_name, Total_Edits, ROW_NUMBER() OVER (PARTITION BY wiki_language ORDER BY Total_Edits DESC) AS rank FROM RollingEdits ) SELECT user_id, user_name, Total_Edits FROM RankedEdits WHERE rank <= 5 ORDER BY Total_Edits DESC;
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...