This query is marked as a draft This query has been published by Cryptic.

SQL

x
 
SET @pfx = 'A%';
SELECT page_title
FROM page AS main
WHERE EXISTS (SELECT 1
              FROM page AS talk
              JOIN templatelinks ON talk.page_id = tl_from
              WHERE talk.page_namespace = 1
                AND talk.page_title = main.page_title
                AND tl_from_namespace = 1
                AND tl_namespace = 10
                AND tl_title='WikiProject_Biography')
  AND main.page_namespace = 0
  AND main.page_title RLIKE '^[[:alpha:]]+_[[:upper:]]\\._[[:alpha:]]+$'
  AND main.page_title LIKE @pfx
  AND NOT EXISTS (SELECT 1
                  FROM page AS other
                  WHERE other.page_namespace = 0
                    AND other.page_title != main.page_title
                    AND other.page_title LIKE @pfx
                    AND SUBSTRING_INDEX(other.page_title, '_', 1) = SUBSTRING_INDEX(main.page_title, '_', 1) -- first word matches
                    AND SUBSTRING_INDEX(other.page_title, '_', -1) = SUBSTRING_INDEX(main.page_title, '_', -1) -- last word matches
                    AND other.page_title LIKE '%\\_%') -- at least two words in other
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.
All SQL code is licensed under CC0 License.

Checking query status...