SQL
AخA
select distinct concat("Category:",page_title) from categorylinks a
join page on page_id=a.cl_from
where page_namespace=14
and (a.cl_to="Hidden_categories" or a.cl_to like "CatAutoTOC%" or a.cl_to like "Navseasoncats%" or a.cl_to like "Template%"
or a.cl_to like "Portal_template%"
or a.cl_to like "Commons_category%")
and not exists (select 1 from categorylinks b where a.cl_from = b.cl_from and b.cl_to != "Hidden_categories"
and b.cl_to not like "%CatAutoTOC%" and b.cl_to not like "%Navseasoncats%" and b.cl_to not like "%Commons_category%"
and (page_title like "Template%" or b.cl_to not like "%Template%") and b.cl_to not like "Portal_template%");
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.