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
EqJjgOa8rVvsRmZL
.
Toggle Highlighting
SQL
SELECT p1.page_title, GROUP_CONCAT(pl_title SEPARATOR ', '), IF(p2.page_is_redirect = 1, rd_title, p2.page_title), COUNT(distinct IF(p2.page_is_redirect = 1, rd_title, p2.page_title)) as links FROM page p1 LEFT JOIN pagelinks ON pl_from = p1.page_id AND pl_namespace = 0 JOIN page p2 on pl_title = p2.page_title and p2.page_namespace = 0 and p2.page_title not like 'MOS:%' LEFT JOIN redirect on p2.page_id = rd_from -- and rd_namespace = 0 -- AND pl_title IN (select p2.page_title from page p2 where p2.page_namespace = 0) WHERE p1.page_id IN ( select cl_from from categorylinks where cl_to in ("All_disambiguation_pages"/*, "All_set_index_articles"*/) and cl_type = 'page' ) AND p1.page_namespace = 0 AND p1.page_is_redirect = 0 AND p1.page_title not like 'MOS:%' AND p1.page_title not like '%\_(disambiguation)' /* and p1.page_id in ( select rev_page from revision join actor_revision on actor_id = rev_actor where rev_id = p1.page_latest and (actor_user is null or actor_user in ( select user_id from user where user_editcount < 10 )) ) */ AND (p2.page_is_redirect = 0 or rd_namespace = 0) GROUP BY p1.page_title -- HAVING p1.page_title LIKE '%\_(disambiguation)' AND links < 2 OR links < 1 HAVING links < 2 ORDER BY links
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...