Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
edit bucket distributions (active editors)
by
KCVelaga (WMF)
This query is marked as a draft
This query has been published
by
KCVelaga (WMF)
.
Toggle Highlighting
SQL
WITH active_editors AS ( SELECT rev_actor, COUNT(rev_id) AS recent_edit_count FROM revision WHERE rev_timestamp > '20211201000000' AND rev_timestamp < '20220228235959' GROUP BY rev_actor HAVING COUNT(rev_id) >= 5), non_bot_editors AS ( SELECT actor_id, user_id, user_name, user_editcount FROM actor JOIN user ON actor.actor_user = user.user_id LEFT JOIN user_groups ON ug_user = user_id WHERE user_editcount>0 AND (ug_group NOT IN ('bot', 'flow-bot') OR ug_group IS NULL)), non_bot_active_editors AS ( SELECT non_bot_editors.user_id AS user_id, non_bot_editors.user_editcount AS total_edit_count, active_editors.recent_edit_count AS recent_edit_count FROM active_editors INNER JOIN non_bot_editors ON active_editors.rev_actor = non_bot_editors.actor_id) SELECT COUNT(DISTINCT user_id), CASE WHEN total_edit_count <= 4 THEN '1 to 4 edits' WHEN total_edit_count >= 5 AND total_edit_count <= 99 THEN '5 to 99 edits' WHEN total_edit_count >= 100 AND total_edit_count <= 999 THEN '100 to 999 edits' WHEN total_edit_count >= 1000 THEN '1000+ edits' END AS edit_bucket FROM non_bot_active_editors GROUP BY edit_bucket
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...