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
Edgars2007
.
select lt.lt_title as pl_title , count(*) as c , lt.lt_namespace as pl_namespace from pagelinks pl join linktarget lt on lt.lt_id=pl.pl_target_id where pl.pl_from_namespace=0 and lt.lt_namespace=0 group by lt.lt_title, lt.lt_namespace having count(*)>100
Toggle Highlighting
SQL
SELECT disambigs.page_title, COUNT(DISTINCT links.pl_from) AS direct_links, COUNT(DISTINCT redirects.page_id) AS redirects, COUNT(DISTINCT links.pl_from) + COUNT(DISTINCT links_to_redirects.pl_from) AS all_backlinks FROM (SELECT * FROM page WHERE page_is_redirect=0 and page_namespace=0) AS disambigs #JOIN page AS disambigs # ON disambigs.page_id = pp_page LEFT JOIN (SELECT * FROM pagelinks join linktarget lt on lt.lt_id=pl.pl_target_id WHERE pl_from_namespace = 0) AS links ON links.lt_title = disambigs.page_title AND links.lt_namespace = disambigs.page_namespace LEFT JOIN page AS redirects ON redirects.page_is_redirect = 1 AND redirects.page_id = links.pl_from AND redirects.page_namespace = disambigs.page_namespace LEFT JOIN (SELECT * FROM pagelinks WHERE pl_from_namespace = 0) AS links_to_redirects ON links_to_redirects.pl_title = redirects.page_title AND links_to_redirects.pl_namespace = redirects.page_namespace where not exists (select * from categorylinks c566 where disambigs.page_id = c566.cl_from AND c566.cl_to in ("Izolētie_raksti","Nozīmju_atdalīšana")) GROUP BY disambigs.page_title having all_backlinks=0 ORDER BY all_backlinks DESC, direct_links DESC, redirects, disambigs.page_title
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...