Jump to content

User talk:Yamaha5/enwiki articles with two birth categories

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
USE enwiki_p;
SELECT DISTINCT frpage.page_title, frst.cl_to
FROM categorylinks AS frst INNER JOIN page as frpage ON frst.cl_from=frpage.page_id and frpage.page_namespace=0 and frpage.page_is_redirect = 0
WHERE frst.cl_to LIKE '%_births'
and frst.cl_to not LIKE '%-century%'
and frst.cl_to not LIKE '%s_%'
AND frst.cl_to REGEXP '[0-9]+'
and frpage.page_title not like '%_and_%'
and frpage.page_title not like '%_Brothers'
and frpage.page_title not like '%_Sisters'
and frpage.page_title not like '%_Twins'
and frpage.page_title not like '%_family%'
and frpage.page_title not like '%_brothers'
and frpage.page_title not like '%_murders'
and frpage.page_title not like '%_&_%'
AND frst.cl_from IN (
  SELECT DISTINCT cl_from
  FROM categorylinks AS scnd INNER JOIN page As secPage ON scnd.cl_from=secPage.page_id and secPage.page_namespace=0 and secPage.page_is_redirect = 0
WHERE scnd.cl_to LIKE '%_births'
AND scnd.cl_to REGEXP '[0-9]+'
and scnd.cl_to not LIKE '%-century%'
and scnd.cl_to not LIKE '%s_%'
  AND frst.cl_to <>scnd.cl_to
) order by 1
;

the query Yamaha5 (talk) 12:11, 24 July 2016 (UTC)[reply]