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
ಮಲ್ನಾಡಾಚ್ ಕೊಂಕ್ಣೊ
.
Toggle Highlighting
SQL
select ROW_NUMBER() OVER(order by lt_title) num, -- get row number CONCAT('[[Template:', replace(lt_title, '_', ' '), ']]') as 'Template title' -- Format as wikilink, replace _ with space from templatelinks join linktarget on tl_target_id = lt_id join page on page_namespace = lt_namespace and page_title = lt_title where lt_namespace = 10 -- Template namespace and page_is_redirect = 0 -- Exclude template redirects and lt_title not in (select page_title -- Excludes templates if they are in one of the categories below from page join categorylinks on page_id = cl_from where cl_to in ('Template_test_cases', 'Template_sandboxes', 'Template_documentation_pages', 'Stub_message_templates', 'Wikipedia_transclusionless_templates', 'Taxonomy_templates') and page_namespace = 10) and page_title not in (select page_title -- Excludes templates with title matching any on the below patterns from page where (page_title like 'PDB_Gallery%' or page_title like 'TFA_title%' or page_title like 'Country_data%' or page_title like 'Did_you_know_nominations/%') and page_namespace = 10) group by lt_title having COUNT(*) = 1 -- Template has exactly one transclusion order by 'Template title' asc; -- arrange in ascending otder
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...