SQL
AخA
SELECT lt_title, COUNT(*) AS backlinks, SUM(IF(tl_from_namespace = 0, 1, 0)) AS from_main,
IF(page_title IS NULL, 0, 1) AS page_exists, IF(page_title IS NULL, 0, page_is_redirect) AS page_is_redirect
FROM linktarget
JOIN templatelinks ON tl_target_id = lt_id
LEFT JOIN page ON page_title = lt_title AND page_namespace = lt_namespace
WHERE lt_namespace = 10
AND lt_title LIKE "Infobox\_%"
AND NOT lt_title LIKE "Infobox\_-\_%"
AND lt_title NOT LIKE "%/%"
AND lt_title NOT LIKE "%položka%"
AND lt_title NOT IN ("Infobox_hlavička", "Infobox_konec", "Infobox_obrázek", "Infobox_začátek")
AND lt_title NOT LIKE "%podinfobox%"
GROUP BY lt_title
ORDER BY page_exists DESC, backlinks DESC, from_main DESC, lt_title;
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.