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
Aram
.
Toggle Highlighting
SQL
USE ckbwiki_p; SELECT RowNumber AS Rank, CONCAT('[[User:', UserName, '|', UserName, ']]') AS UserName, NumberOfArticles, TotalBytes, ArticlesScore, BytesScore, TotalScore FROM ( SELECT RANK() OVER (ORDER BY (0.5 * (NumberOfArticles / MaxArticles) + 0.5 * (TotalBytes / MaxBytes)) DESC) AS RowNumber, actor_name AS UserName, COUNT(*) AS NumberOfArticles, SUM(rev_len) AS TotalBytes, 0.5 * (COUNT(*) / MAX(ArticleCount)) AS ArticlesScore, 0.5 * (SUM(rev_len) / MAX(BytesSum)) AS BytesScore, (0.5 * (COUNT(*) / MAX(ArticleCount)) + 0.5 * (SUM(rev_len) / MAX(BytesSum))) AS TotalScore FROM revision JOIN ( SELECT DISTINCT rev_page, MIN(rev_id) AS first_revision_id FROM revision WHERE rev_parent_id = 0 AND rev_timestamp BETWEEN 20090101000000 AND 20231021000000 GROUP BY rev_page ) AS first_revisions ON revision.rev_id = first_revisions.first_revision_id JOIN actor ON actor.actor_id = revision.rev_actor JOIN page ON page.page_id = revision.rev_page JOIN ( SELECT pl_title FROM pagelinks WHERE pl_from = 157289 AND pl_namespace = 2 ) AS UserPage ON actor_name LIKE UserPage.pl_title JOIN ( SELECT actor_name, COUNT(*) AS ArticleCount, SUM(rev_len) AS BytesSum FROM revision JOIN ( SELECT DISTINCT rev_page, MIN(rev_id) AS first_revision_id FROM revision WHERE rev_parent_id = 0 AND rev_timestamp BETWEEN 20090101000000 AND 20231021000000 GROUP BY rev_page ) AS first_revisions ON revision.rev_id = first_revisions.first_revision_id JOIN actor ON actor.actor_id = revision.rev_actor GROUP BY actor_name ) AS UserStats ON actor_name = UserStats.actor_name GROUP BY actor_name ) AS RankedUsers ORDER BY Rank;
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...