SQL
AخA
USE elwiki_p;
SELECT CONCAT('* [[',disambigs.page_title,']]'), COUNT(*), SUM(redirects.page_is_redirect)
FROM (SELECT * FROM page_props WHERE pp_propname = 'disambiguation') AS disambigs
JOIN page AS disambigs
ON disambigs.page_id = pp_page
JOIN (SELECT * FROM pagelinks WHERE pl_from_namespace = 0) AS links
ON pl_title = disambigs.page_title AND pl_namespace = disambigs.page_namespace
JOIN page AS redirects
ON redirects.page_id = links.pl_from AND redirects.page_namespace = disambigs.page_namespace
GROUP BY disambigs.page_title
ORDER BY COUNT(*) DESC, disambigs.page_title
LIMIT 2000;
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.