Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
nds_nlwiki Links to disambiguation pages
by
Bdijkstra
This query is marked as a draft
This query has been published
by
Bdijkstra
.
Toggle Highlighting
SQL
SELECT dp_ns, dp_title, COUNT(pl_from) AS 'count', GROUP_CONCAT(DISTINCT df_ns SEPARATOR '|') AS 'df_ns', GROUP_CONCAT(DISTINCT df_title SEPARATOR '|') AS 'df_title' FROM (( # direct links from non-redirects to disambiguation pages SELECT dp.page_namespace AS dp_ns, dp.page_title AS dp_title, pl_from, df.page_namespace AS df_ns, df.page_title AS df_title FROM page fp, pagelinks, page dp, page_props, page df WHERE fp.page_namespace=10 AND fp.page_id=pl_from AND fp.page_is_redirect=0 AND pl_namespace=dp.page_namespace AND pl_title=dp.page_title AND dp.page_is_redirect=0 AND dp.page_id=pp_page AND pp_propname='disambiguation' AND df.page_id=pl_from ) UNION ( # links from non-redirects to redirects to disambiguation pages SELECT dp.page_namespace AS dp_ns, dp.page_title AS dp_title, pl_from, df.page_namespace AS df_ns, df.page_title AS df_title FROM page fp, pagelinks, page rp, redirect, page dp, page_props, page df WHERE fp.page_namespace=10 AND fp.page_id=pl_from AND fp.page_is_redirect=0 AND pl_namespace=rp.page_namespace AND pl_title=rp.page_title AND rp.page_is_redirect=1 AND rp.page_id=rd_from AND rd_namespace=dp.page_namespace AND rd_title=dp.page_title AND dp.page_is_redirect=0 AND dp.page_id=pp_page AND pp_propname='disambiguation' AND df.page_id=pl_from )) t GROUP BY page_namespace, page_title ORDER BY `count` DESC LIMIT 50; /*SELECT page_namespace, page_title, COUNT(pl_from) AS 'count' FROM (( # direct links from non-redirects to disambiguation pages SELECT dp.page_namespace, dp.page_title, pl_from FROM page fp, pagelinks, page dp, page_props WHERE fp.page_namespace=10 AND fp.page_id=pl_from AND fp.page_is_redirect=0 AND pl_namespace=dp.page_namespace AND pl_title=dp.page_title AND dp.page_is_redirect=0 AND dp.page_id=pp_page AND pp_propname='disambiguation' ) UNION ( # links from non-redirects to redirects to disambiguation pages SELECT dp.page_namespace, dp.page_title, pl_from FROM page fp, pagelinks, page rp, redirect, page dp, page_props WHERE fp.page_namespace=10 AND fp.page_id=pl_from AND fp.page_is_redirect=0 AND pl_namespace=rp.page_namespace AND pl_title=rp.page_title AND rp.page_is_redirect=1 AND rp.page_id=rd_from AND rd_namespace=dp.page_namespace AND rd_title=dp.page_title AND dp.page_is_redirect=0 AND dp.page_id=pp_page AND pp_propname='disambiguation' )) t GROUP BY page_namespace, page_title ORDER BY `count` DESC LIMIT 50;*/
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...