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
Polygnotus
.
drafts and articles with the same title
Toggle Highlighting
SQL
SELECT draft.page_title AS draft_title, draft.page_id AS draft_id, article.page_id AS article_id, CONCAT('https://en.wikipedia.org/wiki/Draft:', REPLACE(draft.page_title, ' ', '_')) AS draft_url, CONCAT('https://en.wikipedia.org/wiki/', REPLACE(article.page_title, ' ', '_')) AS article_url, ABS(article_text.old_len - draft_text.old_len) AS length_difference FROM page AS draft JOIN page AS article ON REPLACE(draft.page_title, 'Draft:', '') = article.page_title -- Get latest revision of draft JOIN revision AS draft_rev ON draft.page_id = draft_rev.rev_page AND draft_rev.rev_id = ( SELECT MAX(rev_id) FROM revision WHERE rev_page = draft.page_id ) -- Get draft text JOIN text AS draft_text ON draft_rev.rev_text_id = draft_text.old_id -- Get latest revision of article JOIN revision AS article_rev ON article.page_id = article_rev.rev_page AND article_rev.rev_id = ( SELECT MAX(rev_id) FROM revision WHERE rev_page = article.page_id ) -- Get article text JOIN text AS article_text ON article_rev.rev_text_id = article_text.old_id WHERE draft.page_namespace = 118 -- Draft namespace AND article.page_namespace = 0 -- Main namespace AND draft.page_is_redirect = 0 -- Exclude redirects AND article.page_is_redirect = 0 -- Exclude redirects ORDER BY length_difference DESC LIMIT 10;
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...