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
Wurgl
.
Rotlinks in Artikeln (außer BKS) bei denen die ersten zwei Buchstaben im Klammerteil gleich sind wie vorhandener Blaulink
Toggle Highlighting
SQL
WITH pl AS (SELECT CONCAT(SUBSTRING_INDEX(pl_title, "_(", 1), "_(", LEFT(SUBSTRING_INDEX(pl_title, "_(", -1), 2)) AS pl_short, pl_from, pl_title FROM pagelinks WHERE pl_namespace = 0 AND pl_title LIKE "%\_(%" ), ar AS (SELECT CONCAT(SUBSTRING_INDEX(page_title, "_(", 1), "_(", LEFT(SUBSTRING_INDEX(page_title, "_(", -1), 2)) AS ar_short, page_id AS ar_id FROM page WHERE page_namespace = 0 AND page_title like "%\_(%" ) SELECT CONCAT("[[", REPLACE(article.page_title, "_", " "), "]]") AS "Artikel", CONCAT("[[", REPLACE(pl_title, "_", " "), "]]") AS "Rotlink", GROUP_CONCAT(CONCAT("[[", REPLACE(similar.page_title, "_", " "), "]]") SEPARATOR " • ") AS "Ähnliche Artikel" FROM pl LEFT JOIN templatelinks ON tl_from = pl_from AND tl_namespace = 10 AND tl_title = 'Begriffsklärung' LEFT JOIN page AS rotlink ON rotlink.page_namespace = pl_namespace AND rotlink.page_title = pl_title, page AS similar, page AS article, ar WHERE tl_from IS NULL AND rotlink.page_id IS NULL AND ar.ar_id = similar.page_id AND ar.ar_short = pl_short AND article.page_id = pl_from GROUP BY article.page_title, pl_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...