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
Bdijkstra
.
(just suffixes w/ lowercase letters for now) 1. count all suffixes in article links 2. get red article links with a suffix 3. join and select rare suffixes (currently: that occur only once) takes 15-20 mins https://nl.wikipedia.org/wiki/Gebruiker:Bdijkstra/quarry/Haakjesanomalieƫn
Toggle Highlighting
SQL
SELECT s.`suffix`, CONCAT('[[:',`from`,']]'), CONCAT('[[:',`to`,']]') FROM ( SELECT `suffix`, COUNT(*) AS `count` FROM (SELECT pl_from, pl_title, REGEXP_REPLACE(pl_title, '^.*_\\(([^\\(\\)]+)\\)$', '\\1') AS `suffix` FROM pagelinks WHERE pl_from_namespace=0 AND pl_namespace=0 AND pl_title REGEXP '_\\([\\p{Ll}_]+\\)$') pls GROUP BY `suffix` HAVING `count`=1 ) s, ( SELECT page_title AS `from`, GROUP_CONCAT(pl_title) AS `to`, `suffix` FROM (SELECT pl_from, pl_title, REGEXP_REPLACE(pl_title, '^.*_\\(([^\\(\\)]+)\\)$', '\\1') AS `suffix` FROM pagelinks WHERE pl_from_namespace=0 AND pl_namespace=0 AND pl_title REGEXP '_\\([\\p{Ll}_]+\\)$' ) pls INNER JOIN page ON pl_from=page_id WHERE NOT EXISTS (SELECT * FROM page WHERE pl_title=page_title AND page_namespace=0) GROUP BY `suffix` ) r WHERE s.suffix=r.suffix LIMIT 5000 /*SELECT `suffix`, COUNT(*) AS `count`, page_title AS `from`, GROUP_CONCAT(pl_title) AS `to` FROM ( SELECT page_title, pl_title, REGEXP_REPLACE(pl_title, '^.*_\\(([^\\(\\)]+)\\)$', '\\1') AS `suffix` FROM pagelinks INNER JOIN page ON pl_from=page_id WHERE NOT EXISTS (SELECT * FROM page WHERE pl_title=page_title AND page_namespace=0) AND pl_from_namespace=0 AND pl_namespace=0 AND pl_title REGEXP '_\\([\\p{Ll}_]+\\)$' #LIMIT 1000 ) t GROUP BY `suffix` HAVING `count`=1 LIMIT 500*/
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...