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, CASE WHEN article_rev.rev_len >= draft_rev.rev_len THEN article_rev.rev_len - draft_rev.rev_len ELSE draft_rev.rev_len - article_rev.rev_len END 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 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 ) 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 100;
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...