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
DannyS712
.
Toggle Highlighting
SQL
SET @c = 'American_screenwriters'; SELECT pg1.page_title, subs.cl_to FROM page AS pg1 JOIN categorylinks AS cl1 ON cl1.cl_from = pg1.page_id JOIN ( SELECT cl2.cl_from, cl2.cl_to FROM categorylinks AS cl2 WHERE cl2.cl_to IN ( SELECT page_title FROM page pg3 JOIN categorylinks AS cl3 ON pg3.page_id = cl3.cl_from WHERE cl3.cl_to = @c AND cl3.cl_type = 'subcat' ) ) AS subs ON subs.cl_from = cl1.cl_from WHERE cl1.cl_to = @c AND cl1.cl_type = 'page' AND page_namespace = 0 LIMIT 1; SELECT pg1.page_title, cl1.cl_to FROM page pg1 JOIN categorylinks cl1 ON cl1.cl_from = pg1.page_id WHERE cl1.cl_to IN ( SELECT pg2.page_title FROM page pg2 JOIN categorylinks cl2 ON cl2.cl_from = pg2.page_id WHERE cl2.cl_to IN ( SELECT pg3.page_title FROM page pg3 JOIN categorylinks cl3 ON cl3.cl_from = pg3.page_id WHERE cl_to = @c AND cl_type = 'subcat' ) AND cl2.cl_type = 'subcat' ) LIMIT 100;
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...