This query is marked as a draft This query has been published by Vahurzpu.

SQL

x
 
SELECT pagelinks.pl_title, COUNT(pagelinks.pl_title), 
    (SELECT COUNT(*) FROM pagelinks tls
     WHERE tls.pl_from_namespace = 10
     AND tls.pl_title = pagelinks.pl_title
     AND tls.pl_namespace = 0
    ) AS tl_link_count
FROM page talkpage
INNER JOIN categorylinks ON talkpage.page_id = categorylinks.cl_from
INNER JOIN page mainpage ON mainpage.page_title = talkpage.page_title
INNER JOIN pagelinks ON mainpage.page_id = pagelinks.pl_from
WHERE categorylinks.cl_to = "WikiProject_Virginia_articles"
AND pl_namespace = 0 AND mainpage.page_namespace = 0 AND talkpage.page_namespace = 1
AND pl_title NOT IN (SELECT page_title FROM page WHERE page.page_namespace = 0)
GROUP BY pagelinks.pl_title
ORDER BY COUNT(pagelinks.pl_title) DESC
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...