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
Mike.Khoroshun
.
Toggle Highlighting
SQL
SELECT CONCAT('Q', ips.ips_item_id) AS wikidata_item_id, COUNT(*) AS links, COALESCE(ips_en.ips_site_page, ips_max.ips_site_page) AS article_name, CASE WHEN ips_en.ips_site_page IS NOT NULL THEN 'enwiki' ELSE ips_max.ips_site_id END AS site_id FROM wb_items_per_site ips LEFT JOIN ( SELECT ips_item_id, ips_site_page FROM wb_items_per_site WHERE ips_site_id = 'enwiki' ) ips_en ON ips_en.ips_item_id = ips.ips_item_id LEFT JOIN ( SELECT ips_item_id, ips_site_id, ips_site_page FROM wb_items_per_site WHERE ips_site_id LIKE '%wiki' ) ips_max ON ips_max.ips_item_id = ips.ips_item_id LEFT JOIN page p ON p.page_title = CONCAT('Q', ips.ips_item_id) AND p.page_namespace = 0 WHERE ips.ips_site_id LIKE '%wiki' GROUP BY ips.ips_item_id ORDER BY links DESC LIMIT 100;
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...