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
Andreyyshore
.
Testing a version that uses distinct column names, since the usual one suddenly started freaking out. Also, the results have been wrong since late February 2022 and I'm trying to investigate why.
Toggle Highlighting
SQL
SELECT COUNT(1) AS pages_with_disambig_but_not_redir FROM page WHERE (page_namespace = 0 AND page_is_redirect = 0); SELECT user_id AS user_id_final, CASE WHEN user_id = -2 THEN CONCAT("<", COUNT(1), " registered users under the threshold>") ELSE user_name END AS user_name_final, user_articles AS user_articles_final, user_latestcreation AS user_latestcreation_final FROM ( SELECT CASE WHEN user_articles_ >= 10 THEN user_id_ ELSE -2 END AS user_id, user_name_ AS user_name, user_articles_ AS user_articles, CASE WHEN user_articles_ >= 10 THEN user_latestcreation_ ELSE 0 END AS user_latestcreation FROM ( SELECT CASE WHEN user_id__ IS NULL THEN -1 ELSE user_id__ END AS user_id_, CASE WHEN user_id__ IS NULL THEN CONCAT("<", COUNT(DISTINCT actor_id__), " unregistered users>") ELSE user_name__ END AS user_name_, COUNT(user_articles__) AS user_articles_, CASE WHEN user_id__ IS NULL THEN 0 ELSE MAX(rev_timestamp_) END AS user_latestcreation_ FROM ( SELECT actor_id AS actor_id__, actor_user AS user_id__, actor_name AS user_name__, 1 AS user_articles__, rev_timestamp_ FROM ( SELECT rev_actor, rev_timestamp_ FROM ( -- SELECT rev_actor, MIN(rev_timestamp) AS rev_timestamp_ FROM revision SELECT rev_actor, rev_timestamp AS rev_timestamp_, rev_page FROM revision GROUP BY rev_page ) AS revtable LEFT JOIN page ON revtable.rev_page = page.page_id WHERE (page_namespace = 0 AND page_is_redirect = 0) ) AS uti LEFT JOIN actor ON uti.rev_actor = actor.actor_id ) AS uti_ GROUP BY user_id__ ) AS uti__ ) AS uti___ GROUP BY user_id_ ORDER BY user_articles 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...