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
RP88
.
Toggle Highlighting
SQL
USE commonswiki_p; SELECT concat("Template:",license.page_title) as pagename-- list of license templates FROM page license -- transclude "License_template_tag" INNER JOIN templatelinks t1 ON t1.tl_from = license.page_id AND t1.tl_title = 'License_template_tag' WHERE license.page_title not like "%/%" and -- no subtemplates license.page_namespace = 10 AND -- not in "Primary_license_tags_(flat_list)" or "Style_formatting_templates" categories license.page_id NOT IN (SELECT cl_from FROM categorylinks WHERE cl_to = "Primary_license_tags_(flat_list)" or cl_to = "Style_formatting_templates" or cl_to = "License-related_tags" ) AND NOT exists ( -- does not transclude any templates in "Primary_license_tags_(flat_list)" category SELECT * FROM templatelinks t2 WHERE t2.tl_from = license.page_id AND t2.tl_title IN (SELECT p2.page_title -- templates in "Primary_license_tags_(flat_list)" category FROM page p2 INNER JOIN categorylinks c2 on c2.cl_from = p2.page_id WHERE p2.page_namespace = 10 AND c2.cl_to = "Primary_license_tags_(flat_list)" ) limit 1 )
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...