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
Horcrux
.
Toggle Highlighting
SQL
CREATE TABLE dis ( p1 varbinary(255) not null, p2 varbinary(255) not null ); INSERT INTO dis( SELECT page_title, SUBSTR(page_title, 1, CHAR_LENGTH(page_title)-LOCATE('(_', REVERSE(page_title))-1) as p2 FROM page WHERE page_namespace=0 AND page_is_redirect = 1 AND page_title regexp '_\\([^)]+\\)$' ); INSERT INTO dis( SELECT page_title, SUBSTR(page_title, 1, CHAR_LENGTH(page_title)-LOCATE('()', REVERSE(page_title))) as p2 FROM page WHERE page_namespace=0 AND page_is_redirect = 1 AND page_title regexp '\\)\\([^)]+\\)$' ); SELECT CONCAT('*[[', p1, ']] -> [[', p2, ']]') FROM dis JOIN page ON p1 = page_title JOIN redirect ON page_id = rd_from WHERE page_namespace = 0 AND rd_namespace=0 AND rd_title = p2 ORDER BY p1;
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...