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

SQL

x
 
SELECT DISTINCT pp.pp_value, p1.page_title
FROM page as p1
JOIN page_props AS pp 
ON pp.pp_page = p1.page_id 
AND pp.pp_propname = 'wikibase_item'
AND p1.page_namespace=14 
AND p1.page_is_redirect=0
LEFT JOIN templatelinks AS tl 
ON tl.tl_from = p1.page_id 
AND tl.tl_from_namespace = 14 
AND tl_target_id = (SELECT lt_id FROM linktarget WHERE lt_namespace = 10 AND lt_title = 'Wikidata_Infobox')
WHERE tl.tl_target_id IS NULL
AND (
        SELECT cl1.cl_from
        FROM categorylinks AS cl1 WHERE cl1.cl_to = 'Category_redirects'  AND cl_type = 'subcat'
        AND cl1.cl_from = p1.page_id
        LIMIT 1
    ) IS NULL
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...