SQL
AخA
USE wikidatawiki_p;
SELECT CONCAT('*\\',wsr.ips_site_page,' \\ [[Q',wsr.ips_item_id,']] \\ ',wsr.Nr),
CONCAT('\\',wru.ips_site_page,' \\ [[Q',wru.ips_item_id,']] \\ ',wru.Nr)
#count(wsr.ips_site_page)
FROM (SELECT ips_item_id, ips_site_page, count(wsr.ips_site_id) as Nr FROM wb_items_per_site WHERE ips_site_id = "srwiki"
and ips_item_id not in (select ips_item_id from wb_items_per_site where ips_site_id = "ruwiki")) AS wsr
JOIN (SELECT ips_item_id, ips_site_page, count(wsr.ips_site_id) as Nr FROM wb_items_per_site WHERE ips_site_id = "ruwiki"
and ips_item_id not in (select ips_item_id from wb_items_per_site where ips_site_id = "srwiki")) AS wru
ON wsr.ips_site_page = wru.ips_site_page
JOIN (SELECT * FROM pagelinks JOIN wb_entity_per_page ON epp_page_id = pl_from
WHERE pl_namespace = 0 and pl_title = "Q4167410") as plensr
ON wsr.ips_item_id = plensr.epp_entity_id
JOIN (SELECT * FROM pagelinks JOIN wb_entity_per_page ON epp_page_id = pl_from
WHERE pl_namespace = 0 and pl_title = "Q4167410") as plenru
on wru.ips_item_id = plenru.epp_entity_id
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.