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
DreamRimmer
.
Toggle Highlighting
SQL
WITH pending_drafts AS ( SELECT page_id, page_title FROM categorylinks JOIN page ON cl_from = page_id WHERE cl_type = 'page' AND cl_namespace = 118 AND cl_to = 'Pending_AfC_submissions' ), last_submissions AS ( SELECT page_id, MAX.rev_id AS last_submission_rev, MAX.rev_timestamp AS last_submission_timestamp FROM revision JOIN revision_comment_temp ON rev_id = rct_revision JOIN pending_drafts ON rev_page = page_id WHERE rct_comment LIKE 'Submitting using%' GROUP BY page_id ), last_declines AS ( SELECT page_id, MAX.rev_id AS last_decline_rev, MAX.rev_timestamp AS last_decline_timestamp FROM revision JOIN revision_comment ON rev_id = rct_revision JOIN pending_drafts ON rev_page = page_id WHERE rct_comment LIKE 'Declining submission:%' GROUP BY page_id ), comparison AS ( SELECT pd.page_title, ls.last_submission_rev, ls.last_submission_timestamp, ld.last_decline_rev, ld.last_decline_timestamp, (SELECT LENGTH(text) FROM text WHERE old_id = ls.last_submission_rev) - (SELECT LENGTH(text) FROM text WHERE old_id = ld.last_decline_rev) AS text_diff FROM pending_drafts pd JOIN last_submissions ls ON pd.page_id = ls.page_id JOIN last_declines ld ON pd.page_id = ld.page_id WHERE ls.last_submission_timestamp > ld.last_decline_timestamp ) SELECT * FROM comparison WHERE ABS(text_diff) < 100 ORDER BY text_diff;
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...