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

SQL

x
 
SELECT DISTINCT
    CONCAT('[[Portal:', p.page_title, ']]') AS 'Existing base page',
    p.page_is_redirect,
    CONCAT('[[Portal:', ar_title, ']]') AS 'Deleted subpage',
    CASE WHEN EXISTS (SELECT 1 FROM page p2
                      WHERE p2.page_namespace = 100
                          AND p2.page_title = ar_title)
         THEN 'Y'
         ELSE 'N'
    END AS 'Deleted subpage exists'
FROM archive
JOIN page p
    ON p.page_namespace = 100 -- Portal:
    AND p.page_title = REGEXP_REPLACE(ar_title, '/.*', '')
WHERE ar_namespace = 100
    AND ar_title LIKE '%/%';
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...