Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Sub-cats of Commons cats linked from a page
by
Jheald
This query is marked as a draft
This query has been published
by
Jheald
.
Sub-categories of a Commons category, with Wikidata sitelinks, but with no Wikidata infobox template
Toggle Highlighting
SQL
use commonswiki_p; SELECT DISTINCT pl1.pl_title, GROUP_CONCAT(p3.page_title SEPARATOR ' / ') AS subcats FROM page AS p1 JOIN pagelinks AS pl1 ON pl1.pl_from=p1.page_id AND pl1.pl_from_namespace=p1.page_namespace AND pl1.pl_namespace=14 JOIN categorylinks AS c2 ON c2.cl_to = pl1.pl_title JOIN page AS p3 ON c2.cl_from=p3.page_id AND p3.page_namespace=14 AND p3.page_is_redirect=0 #JOIN categorylinks AS c_up ON c_up.cl_from=p2.page_id WHERE p1.page_title='Jheald/temp4' AND p1.page_namespace=2 AND p3.page_title LIKE %Map% GROUP BY pl1.pl_title; # 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
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...