SQL
AخA
SELECT cat_title,
cl_type,
COUNT(*) AS 'actual',
CASE cl_type
WHEN 'page' THEN cat_pages - cat_subcats - cat_files
WHEN 'subcat' THEN cat_subcats
WHEN 'file' THEN cat_files
ELSE cl_type
END AS 'reported'
FROM categorylinks
JOIN category ON cl_to = cat_title
WHERE cl_to IN (SELECT pl_title
FROM pagelinks
JOIN page ON pl_from = page_id
WHERE pl_namespace = 14
AND page_namespace = 10 AND page_title = 'CSD-categories')
GROUP BY cl_to, cl_type
HAVING actual != reported;
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.