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
.
Toggle Highlighting
SQL
USE cswiki_p;/* SELECT * FROM page_props, page, pagelinks AS links WHERE page_id = pp_page AND pp_propname = 'disambiguation' AND page_namespace = 0 AND page_title NOT LIKE '%&_(%' ESCAPE '&' AND pl_namespace = 0 AND pl_title LIKE CONCAT(page_title, '&_(%') ESCAPE '&' AND NOT EXISTS ( SELECT 1 FROM pagelinks AS backlinks WHERE backlinks.pl_from = page_id AND backlinks.pl_namespace = links.pl_namespace AND backlinks.pl_title = links.pl_title ) LIMIT 1;*/ SELECT page_title, title FROM (SELECT DISTINCT SUBSTRING_INDEX(pl_title, '_(', 1) AS title, pl_title, pl_namespace FROM pagelinks WHERE pl_title LIKE '%)') AS sub JOIN page ON page_title = title AND page_namespace = pl_namespace JOIN page_props ON pp_page = page_id WHERE pp_propname = 'disambiguation' AND NOT EXISTS ( SELECT 1 FROM pagelinks AS backlinks WHERE backlinks.pl_from = page_id AND backlinks.pl_namespace = sub.pl_namespace AND backlinks.pl_title = sub.title );
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...