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
Mr. Ibrahem
.
Toggle Highlighting
SQL
USE wikidatawiki_p; SELECT CONCAT("Q",ips1.ips_item_id) AS item, ips1.ips_site_page AS page, COUNT(backlinks.pl_from) AS backlinks FROM (SELECT * FROM wb_items_per_site WHERE ips_site_id = "arwiki") AS ips1 LEFT JOIN (SELECT * FROM pagelinks WHERE pl_namespace = 0 AND pl_from_namespace = 0) AS backlinks ON backlinks.pl_title = CONCAT("Q",ips1.ips_item_id) WHERE NOT EXISTS ( SELECT ips2.ips_row_id FROM wb_items_per_site AS ips2 WHERE ips2.ips_item_id = ips1.ips_item_id AND NOT ips2.ips_site_id = "arwiki" ) GROUP BY ips1.ips_item_id ORDER BY backlinks, 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...