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
Matěj Suchánek
.
This query lists items with no sitelinks which had some sitelinks before, but they were removed. It has its testing alternative at https://quarry.wmflabs.org/query/1269
Toggle Highlighting
SQL
use wikidatawiki_p; SELECT page_id, CONCAT("Q",epp_entity_id), rev_user_text, rev_id, rev_timestamp, ips_site_id # CONCAT('* [[User:',rev_user_text,'|]] [[Special:Diff/',rev_id,'|removed]] a sitelink from [[Q',epp_entity_id,']] at ',rev_timestamp) AS log # ," with comment: ''",REPLACE(REPLACE(REPLACE(rev_comment,' */','}}'),'/* wbsetsitelink-remove:','{{int:wikibase-item-summary-wbsetsitelink-remove|'),'}} ','}}: '),"''" FROM revision AS revision1 JOIN (SELECT * FROM page WHERE page_is_redirect = 0) ON page_id = revision1.rev_page JOIN wb_entity_per_page ON epp_page_id = page_id # AND epp_redirect_target IS NULL LEFT JOIN wb_items_per_site ON ips_item_id = epp_entity_id # JOIN page AS page2 ON page2.page_id = epp_page_id # LEFT JOIN pagelinks ON pl_title = page2.page_title AND pl_from_namespace = 0 AND pl_from IS NULL WHERE revision1.rev_comment LIKE '/* wbsetsitelink-remove:%' AND ips_site_id IS NULL AND rev_user <> 587697 AND NOT EXISTS ( SELECT * FROM revision AS revision2 WHERE revision2.rev_page = revision1.rev_page AND revision2.rev_comment LIKE '/* wbsetsitelink-remove:%' AND revision2.rev_id > revision1.rev_id) /* AND NOT EXISTS (SELECT * FROM pagelinks WHERE pl_title = page2.page_title AND pl_from_namespace = 0) */ GROUP BY page_title # ORDER BY ips_item_id LIMIT 2000;
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...