Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
taWS:All time Top 100 users by bytes added in NS0
by
Amutha10
This query is marked as a draft
This query has been published
by
Amutha10
.
I added custom conditions to classify "yellow" and "violet" edits using title keywords and namespace values, allowing you to count specific edit types without needing a dedicated tag column.
Toggle Highlighting
SQL
USE tawikisource_p; SELECT actor_name, actor_user, COUNT(actor_name) AS Edit_count, SUM(ABS(CAST(rev.rev_len AS SIGNED) - IF(rev.rev_parent_id=0, 0, CAST(parent.rev_len AS SIGNED)))) AS Gross_byte_count, SUM(CAST(rev.rev_len AS SIGNED) - IF(rev.rev_parent_id=0, 0, CAST(parent.rev_len AS SIGNED))) AS Nett_byte_count, SUM(ABS(CAST(rev.rev_len AS SIGNED) - IF(rev.rev_parent_id=0, 0, CAST(parent.rev_len AS SIGNED)))) / COUNT(actor_name) AS Bytes_per_edit, -- Counting "Yellow" edits based on custom condition SUM(CASE WHEN page.page_title LIKE '%Yellow%' THEN 1 ELSE 0 END) AS Yellow_edit_count, -- Counting "Violet" edits based on custom condition SUM(CASE WHEN page.page_namespace = 1 THEN 1 ELSE 0 END) AS Violet_edit_count FROM revision rev LEFT JOIN actor ON actor_id = rev.rev_actor LEFT JOIN revision parent ON parent.rev_id = rev.rev_parent_id LEFT JOIN page ON page_id = rev.rev_page WHERE page_namespace = 0 AND actor_user IS NOT NULL -- and page_namespace=0 -- and left(rev.rev_timestamp,4)=2020 GROUP BY actor_name ORDER BY Edit_count ASC;
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...