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
Halfak (WMF)
.
Gathers a count of inlinks for English Wikipedia Articles and resolves redirects. Another pass will need to be taken to assign redirect inlinks to the redirectee page.
Toggle Highlighting
SQL
SELECT page.page_id, COUNT(inlinks.pl_from) AS inlinks, redirect.page_id AS redirect_id FROM page LEFT JOIN pagelinks inlinks ON page_namespace = pl_namespace AND page_title = pl_title LEFT JOIN pagelinks redirectlink ON page_is_redirect AND redirectlink.pl_from = page_id LEFT JOIN page redirect ON redirect.page_title = redirectlink.pl_title AND redirect.page_namespace = redirectlink.pl_namespace WHERE page.page_namespace = 0;
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...