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
MMiller (WMF)
.
Toggle Highlighting
SQL
select status, count(*) from ( SELECT current_timestamp() as date, 'Unsubmitted' as status, tp.page_id, tp.page_title FROM page tp LEFT JOIN categorylinks cl1 ON tp.page_id = cl1.cl_from AND cl1.cl_to = 'Pending_AfC_submissions' LEFT JOIN templatelinks t ON tp.page_id = t.tl_from AND (tl_title = 'AFC_submission/declined') WHERE t.tl_from is null AND cl1.cl_to is null AND tp.page_is_redirect = 0 AND tp.page_namespace = 118 union all SELECT current_timestamp() as date, 'Awaiting first review' as status, tp.page_id, tp.page_title FROM page tp INNER JOIN categorylinks cl1 ON tp.page_id = cl1.cl_from AND cl1.cl_to = 'Pending_AfC_submissions' LEFT JOIN templatelinks t ON tp.page_id = t.tl_from AND (tl_title = 'AFC_submission/declined') WHERE t.tl_from is null AND tp.page_is_redirect = 0 AND tp.page_namespace = 118 union all SELECT current_timestamp() as date, 'Awaiting subsequent review' as status, tp.page_id, tp.page_title FROM page tp INNER JOIN categorylinks cl1 ON tp.page_id = cl1.cl_from AND cl1.cl_to = 'Pending_AfC_submissions' LEFT JOIN templatelinks t ON tp.page_id = t.tl_from AND (tl_title = 'AFC_submission/declined') WHERE t.tl_from is not null AND tp.page_is_redirect = 0 AND tp.page_namespace = 118 union all SELECT current_timestamp() as date, 'Declined' as status, tp.page_id, tp.page_title FROM page tp LEFT JOIN categorylinks cl1 ON tp.page_id = cl1.cl_from AND cl1.cl_to = 'Pending_AfC_submissions' LEFT JOIN templatelinks t ON tp.page_id = t.tl_from AND (tl_title = 'AFC_submission/declined') WHERE t.tl_from is not null AND cl1.cl_to is null AND tp.page_is_redirect = 0 AND tp.page_namespace = 118 ) a group by 1 order by status
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...