Fork of All Louisville area-related articles by StefenTower
This query is marked as a draft This query has been published by StefenTower.

SQL

AخA
 
# All Louisville area-related pages
SELECT subjectpage.page_title subjectpagetitle,
(
  SELECT COUNT(*), COUNT(*) / p.page_len
  FROM page p
  INNER JOIN pagelinks pl ON p.page_id = pl.pl_from
  INNER JOIN linktarget lt on pl.pl_target_id = lt.lt_id
  WHERE p.page_namespace = 0 AND p.page_id = subjectpage.page_id
  AND lt.lt_namespace = 0
) pagelinkcount
FROM page AS subjectpage
INNER JOIN page AS talkpage on subjectpage.page_title = talkpage.page_title 
INNER JOIN categorylinks ON cl_from = talkpage.page_id
WHERE cl_to = 'WikiProject_Louisville_articles'
AND subjectpage.page_namespace = 0 
AND subjectpage.page_is_redirect = 0
AND talkpage.page_namespace = 1
AND talkpage.page_id NOT IN
        (
        SELECT  page_id
        FROM    page AS dabtalkpage
        INNER JOIN categorylinks ON cl_from = dabtalkpage.page_id
        WHERE cl_to = 'Disambig-Class_Louisville_articles'
        )
ORDER BY pagelinkcount 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.
All SQL code is licensed under CC0 License.

Checking query status...