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
.
Based on https://phabricator.wikimedia.org/T63881
Toggle Highlighting
SQL
USE wikidatawiki_p; SELECT * # ips1.ips_site_page AS pagename, CONCAT('Q',ips.ips_item_id) AS firstEntity, CONCAT('Q',ips.ips_item_id) AS secondEntity FROM (SELECT * FROM pagelinks WHERE pl_title = "Q4167410" AND pl_from_namespace = 0) AS pl1 JOIN (SELECT * FROM pagelinks WHERE pl_title = "Q4167410" AND pl_from_namespace = 0) AS pl2 JOIN wb_entity_per_page AS epp1 ON epp1.epp_page_id = pl1.pl_from JOIN wb_entity_per_page AS epp2 ON epp2.epp_page_id = pl2.pl_from JOIN wb_items_per_site AS ips1 ON ips1.ips_item_id = epp1.epp_entity_id AND ips1.ips_site_page RLIKE '^[A-Z]{2,5}$' JOIN wb_items_per_site AS ips2 ON ips2.ips_item_id = epp2.epp_entity_id AND ips1.ips_site_page = ips2.ips_site_page /*FROM wb_entity_per_page AS epp1 JOIN wb_items_per_site AS ips1 ON ips1.ips_item_id = epp1.epp_entity_id AND ips1.ips_site_page RLIKE '^[A-Z]{2,5}$' JOIN (SELECT * FROM pagelinks WHERE pl_title = "Q4167410" AND pl_from_namespace = 0) AS pl1 ON pl1.pl_from = epp1.epp_page_id JOIN wb_entity_per_page AS epp2 JOIN wb_items_per_site AS ips2 ON ips2.ips_item_id = epp2.epp_entity_id AND ips2.ips_site_page = ips1.ips_site_page JOIN (SELECT * FROM pagelinks WHERE pl_title = "Q4167410" AND pl_from_namespace = 0) AS pl2 ON pl2.pl_from = epp2.epp_page_id FROM wb_items_per_site AS ips1 JOIN wb_entity_per_page AS epp1 ON epp1.epp_entity_id = ips1.ips_item_id JOIN pagelinks AS pl1 ON pl1.pl_from = epp1.epp_page_id AND pl1.pl_title = "Q4167410" JOIN wb_items_per_site AS data2 JOIN wb_entity_per_page AS epp2 ON epp2.epp_entity_id = ips2.ips_item_id JOIN pagelinks AS pl2 ON pl2.pl_from = epp2.epp_page_id AND pl2.pl_title = "Q4167410" */ WHERE # ips1.ips_site_page RLIKE '^[A-Z]{2,6}$' AND ips1.ips_site_page = ips2.ips_site_page ips1.ips_item_id > ips2.ips_item_id GROUP BY ips1.ips_item_id;
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...