Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Categories bypassing template tags on Commons
by
Achim55
This query is marked as a draft
This query has been published
by
Achim55
.
Toggle Highlighting
SQL
USE commonswiki_p; #{{Category redirect}} SELECT now() AS timestamp; (SELECT CONCAT('* [[:Category:', REPLACE(page_title,'_',' '), ']] - redirect') AS cats FROM categorylinks RIGHT JOIN page ON page_id = cl_from AND page_namespace = 14 AND page_title NOT IN ('Broken_category_redirects', 'Non-empty_category_redirects') WHERE cl_to = 'Category_redirects' AND NOT EXISTS (SELECT 1 FROM templatelinks WHERE tl_from = page_id AND tl_namespace = 10 AND tl_title IN ('Category_redirect', 'Cat_redirect', 'Cat-red', 'Cat-redirect', 'Category_Redirect', 'Categoryredirect', 'Catredir', 'Catredirect', 'Redirect_cat', 'Redirect_category', 'See_cat', 'Seecat') ) ) UNION #{{Disambig}} (SELECT CONCAT('* [[:Category:', REPLACE(page_title,'_',' '), ']] - disambig') AS cats FROM categorylinks RIGHT JOIN page ON page_id = cl_from AND page_namespace = 14 AND page_title NOT IN ('Non-empty_disambiguation_categories', 'Disambiguation_of_churches_in_Sweden', 'Disambiguation_of_populated_places', 'Disambiguation_of_temples_in_Japan') WHERE cl_to = 'Disambiguation' AND NOT EXISTS (SELECT 1 FROM templatelinks WHERE tl_from = page_id AND tl_namespace = 10 AND tl_title IN ('Disambig', 'Aimai', 'Begriffsklärung', 'Dab', 'Razločitev') ) ) UNION #{{CatCat}} (SELECT CONCAT('* [[:Category:', REPLACE(page_title,'_',' '), ']] - catcat') AS cats FROM categorylinks RIGHT JOIN page ON page_id = cl_from AND page_namespace = 14 WHERE cl_to = 'Categories_requiring_permanent_diffusion_to_zero' AND NOT EXISTS (SELECT 1 FROM templatelinks WHERE tl_from = page_id AND tl_namespace = 10 AND tl_title IN ('CatCat', 'Catcat', 'Container_category', 'Tracking_category') ) ) UNION #{{MetaCat}} (SELECT CONCAT('* [[:Category:', REPLACE(page_title,'_',' '), ']] - metacat') AS cats FROM categorylinks RIGHT JOIN page ON page_id = cl_from AND page_namespace = 14 AND page_title NOT IN ('Categories_of_countries', 'Flat_categories') WHERE cl_to = 'Meta_categories' AND NOT EXISTS (SELECT 1 FROM templatelinks WHERE tl_from = page_id AND tl_namespace = 10 AND tl_title IN ('MetaCat', 'Metacat') ) ) ORDER BY cats;
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...