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
Gonnym
.
Toggle Highlighting
SQL
SELECT page_title AS 'Template', DATE_FORMAT(MIN(rev_timestamp), '%Y-%m-%d') AS 'First edit', DATE_FORMAT(MAX(rev_timestamp), '%Y-%m-%d') AS 'Latest edit', COUNT(DISTINCT rev_actor) AS 'Unique authors', COUNT(rev_id) AS 'Revisions' FROM ( SELECT page_id, page_title FROM page AS template WHERE NOT EXISTS ( SELECT 1 FROM templatelinks JOIN linktarget ON lt_id = tl_target_id JOIN page AS transcluder ON transcluder.page_id = tl_from WHERE lt_namespace = template.page_namespace AND lt_title = template.page_title AND tl_from != template.page_id AND NOT (transcluder.page_namespace = 11 AND transcluder.page_title = template.page_title) AND NOT (transcluder.page_namespace = 10 AND LEFT(transcluder.page_title, LENGTH(template.page_title) + 1) = CONCAT(template.page_title, '/')) AND NOT (transcluder.page_namespace = 2 AND transcluder.page_title = 'I_am_RedoStone/sandbox') LIMIT 1 ) AND page_namespace = 10 AND page_is_redirect = 0 AND page_title NOT LIKE "Adminstats/%" AND page_title NOT LIKE "AfC_%" AND page_title NOT LIKE "Cite_doi/%" AND page_title NOT LIKE "Cite_pmid/%" AND page_title NOT LIKE "Country_data_%" AND page_title NOT LIKE "Did_you_know_nominations/%" AND page_title NOT LIKE "Editnotices/%" AND page_title NOT LIKE "PBB/%" AND page_title NOT LIKE "POTD_caption/%" AND page_title NOT LIKE "POTD_credit/%" AND page_title NOT LIKE "POTD_protected/%" AND page_title NOT LIKE "Taxonomy/%" AND page_title NOT LIKE "TemplateStyles_sandbox/%" AND page_title NOT LIKE "TFA_title/%" AND page_title NOT LIKE "User_%" AND page_title NOT LIKE "%/testcases" AND page_title NOT LIKE "%/sandbox" AND page_title NOT LIKE "%/rater-data.js" AND page_title NOT LIKE "%-stub" AND page_title NOT IN ( SELECT page_title FROM page JOIN categorylinks ON page_id = cl_from WHERE cl_to IN ( 'All_redirects_for_discussion', 'Computer_language_user_templates', 'Deprecated_templates_kept_for_historical_reasons', 'Inactive_project_pages', 'Language_user_templates', 'Level-zero_userbox_templates', 'Pages_using_the_Graph_extension', 'Parameter_shared_content_templates', 'Template_disambiguation_pages', 'Template_sandboxes', 'Template_test_cases', 'Templates_for_deletion', 'Wikipedia_preloaded_templates', 'Wikipedia_substituted_templates', 'Wikipedia_templates_currently_being_merged_or_deleted', 'Wikipedia_transclusionless_templates' ) AND page_namespace = 10 ) ) AS unused_templates JOIN revision ON rev_page = page_id GROUP BY page_title;
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...