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 categorylinks cl2 ON tp.page_id = cl2.cl_from AND cl2.cl_to = 'Declined_AfC_submissions' WHERE cl2.cl_to 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 LEFT JOIN categorylinks cl1 ON tp.page_id = cl1.cl_from AND cl1.cl_to = 'Pending_AfC_submissions' LEFT JOIN categorylinks cl2 ON tp.page_id = cl2.cl_from AND cl2.cl_to = 'Declined_AfC_submissions' WHERE cl2.cl_to is null AND cl1.cl_to is not 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 LEFT JOIN categorylinks cl1 ON tp.page_id = cl1.cl_from AND cl1.cl_to = 'Pending_AfC_submissions' LEFT JOIN categorylinks cl2 ON tp.page_id = cl2.cl_from AND cl2.cl_to = 'Declined_AfC_submissions' WHERE cl2.cl_to is not null AND cl1.cl_to 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 categorylinks cl2 ON tp.page_id = cl2.cl_from AND cl2.cl_to = 'Declined_AfC_submissions' WHERE cl2.cl_to 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...