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
Matěj Suchánek
.
Links *from* disambiguations are excluded.
Toggle Highlighting
SQL
USE wikidatawiki_p; SELECT CONCAT("[[",items.page_title,"]]") AS item, CONCAT("[[",GROUP_CONCAT(disambigs.page_title ORDER BY disambigs.page_id SEPARATOR "]], [["),"]]") AS linked_disambigs FROM (SELECT * FROM pagelinks WHERE pl_title = 'Q4167410' AND pl_namespace = 0 AND pl_from_namespace = 0) AS disambig_ids JOIN page AS disambigs ON disambigs.page_id = disambig_ids.pl_from JOIN (SELECT * FROM pagelinks WHERE pl_namespace = 0 AND pl_from_namespace = 0) AS item_links ON item_links.pl_title = disambigs.page_title AND item_links.pl_namespace = disambigs.page_namespace LEFT JOIN (SELECT * FROM pagelinks WHERE pl_title = 'Q4167410' AND pl_namespace = 0) AS disambig_links ON disambig_links.pl_from = item_links.pl_from JOIN (SELECT * FROM page WHERE page_is_redirect = 0) AS items ON items.page_id = item_links.pl_from WHERE disambig_links.pl_title IS NULL GROUP BY items.page_id ORDER BY COUNT(*) DESC, items.page_id;
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...