Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Malayalam Wikipedia Articles without images
by
Gnoeee
This query is marked as a draft
This query has been published
by
Gnoeee
.
Toggle Highlighting
SQL
SET @page_title = 'Buon_Natale'; -- Replace 'latest_revision_id' and 'previous_revision_id' with the actual revision IDs SET @latest_revision_id = (SELECT rev_id FROM revision WHERE rev_page IN (SELECT page_id FROM page WHERE page_title = @page_title) ORDER BY rev_id DESC LIMIT 1); SET @previous_revision_id = (SELECT rev_id FROM revision WHERE rev_page IN (SELECT page_id FROM page WHERE page_title = @page_title) ORDER BY rev_id DESC LIMIT 1 OFFSET 1); -- Get the wikitext content for the latest and previous revisions SET @latest_content = (SELECT rev_text FROM revision WHERE rev_id = @latest_revision_id AND rev_page IN (SELECT page_id FROM page WHERE page_title = @page_title)); SET @previous_content = (SELECT rev_text FROM revision WHERE rev_id = @previous_revision_id AND rev_page IN (SELECT page_id FROM page WHERE page_title = @page_title)); -- Identify added images SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(img_name, '|', 1), ']]', 1) AS added_image FROM ( SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(value, '[[File:', -1), '|', 1) AS img_name FROM ( SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@latest_content, '[[File:', number + 1), ']]', 1) AS value FROM numbers WHERE number < LENGTH(@latest_content) - LENGTH(REPLACE(@latest_content, '[[File:', '')) / LENGTH('[[File:') ) AS new_images LEFT JOIN ( SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@previous_content, '[[File:', number + 1), ']]', 1) AS value FROM numbers WHERE number < LENGTH(@previous_content) - LENGTH(REPLACE(@previous_content, '[[File:', '')) / LENGTH('[[File:') ) AS old_images ON new_images.value = old_images.value WHERE old_images.value IS NULL;
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...