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
Nivas10798
.
The following query gives the list of the top ten editors ordered by the number of mainspace edits(shown in the column 'editcount_by_revid') from highest to lowest. The 'rough_editcount' column is
Toggle Highlighting
SQL
SELECT user_name, COUNT(DISTINCT(rev_id)) AS editcount_by_revid, user_editcount AS rough_editcount #Selecting necessary columns FROM revision #Choosing the required table to pull data JOIN page ON rev_page = page_id #Inner joining page on revision table JOIN actor ON rev_actor = actor_id #Inner joining actor on revision table JOIN user ON actor_user = user_id AND actor_user IS NOT NULL #Inner joining user on actor table & removing NULL valued usernames in data LEFT JOIN user_groups ON user_id = ug_user #Left joining user groups on users as few users are not part of any groups WHERE page_namespace = 0 #Checking for mainspace edits only AND (LOWER(CAST(user_name AS CHAR)) NOT LIKE '%bot%') AND (ug_group IS NULL OR ug_group != 'bot') #Discarding bots from data GROUP BY user_name #Grouping by user_name to get the editcount by counting the revision ids ORDER BY editcount_by_revid DESC #Getting the data from highest edit count to lowest edit count LIMIT 10 #Limiting to only ten editors
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...