SQL
AخA
WITH hc AS (
-- list of pages under category:隐藏分类
SELECT p.page_id, p.page_title
FROM categorylinks c
LEFT JOIN page p ON (c.cl_from = p.page_id)
WHERE c.cl_to = "隐藏分类"
)
-- list of categories under each page
SELECT hc.page_id, hc.page_title, c.cat_pages, COUNT(*) AS cat_count
FROM hc
LEFT JOIN categorylinks c2 ON (hc.page_id = c2.cl_from)
LEFT JOIN category c on (c.cat_title = hc.page_title)
GROUP BY 1, 2, 3
HAVING COUNT(*) = 1
ORDER BY 3 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.