SQL
x
USE skwiki_p;
SELECT
page_title AS title,
page_len,
GROUP_CONCAT(cl_to) AS categories
FROM
page,
categorylinks
WHERE
page_namespace = 0 AND
cl_from = page_id AND
cl_to IN ('Wikipédia:Dobré_články', 'Wikipédia:Najlepšie_články') AND
page_title NOT IN (
SELECT
pl_title
FROM
page,
pagelinks
WHERE
pl_from = page_id AND
page_namespace = 4 AND
page_title LIKE 'Odporúčané_články%'
) AND
page_title NOT IN (
SELECT
rd_title
FROM
redirect,
page page_redirect,
pagelinks,
page page_wlsrc
WHERE
rd_from = page_redirect.page_id AND
page_redirect.page_title = pl_title AND
page_redirect.page_namespace = pl_namespace AND
pl_from = page_wlsrc.page_id AND
page_wlsrc.page_namespace = 4 AND
page_wlsrc.page_title LIKE 'Odporúčané_články%'
)
GROUP BY
page_id
ORDER BY
categories DESC, page_len 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.