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
Pppery
.
Convoluted exist queries mean: For each page: Find the lowest tp:tag marked revision such that no later revision (ignoring page moves) is not tp:tag marked
Toggle Highlighting
SQL
select page_id, page_namespace, page_title, page_latest, rt_type, (select min(rt_revision) from revtag where rt_page=page_id and rt_type="tp:tag" and not exists (select 1 from revision where rev_page=page_id and rev_id > rt_revision and (select comment_text from comment_revision where comment_id=rev_comment_id) not like "%moved page%to%" and not exists (select 1 from revtag where rt_revision=rev_id and rt_type="tp:tag"))) as "Oldest" from page join revtag on rt_page=page_id where rt_type="tp:tag" and not exists (select 1 from revtag where rt_page=page_id and rt_type="tp:mark") and rt_revision=page_latest and page_namespace != 2 and not exists (select 1 from categorylinks where cl_from=page_id and cl_to="Looks_useless") order by (select min(rt_revision) from revtag where rt_page=page_id and rt_type="tp:tag" and not exists (select 1 from revision where rev_page=page_id and rev_id > rt_revision and (select comment_text from comment_revision where comment_id=rev_comment_id) not like "%moved page%to%" and not exists (select 1 from revtag where rt_revision=rev_id and rt_type="tp:tag")));
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...