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

SQL

AخA
 
SELECT cl1.cl_to AS 'Category',
       COUNT(*) AS 'Orphaned articles',
       cat_pages AS 'Total pages'
FROM categorylinks cl1
JOIN categorylinks cl2
  ON cl2.cl_from = cl1.cl_from
     AND cl2.cl_to = 'All_orphaned_articles'
LEFT JOIN category
  ON cat_title = cl1.cl_to
GROUP BY cl1.cl_to, cat_pages
ORDER BY COUNT(*) DESC, cat_pages 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...