SQL
AخA
WITH RECURSIVE cats( cl_to, cat_tree, cl_from, cl_type )
AS (SELECT cl_to, cl_to, cl_from, cl_type from categorylinks
WHERE cl_to= 'Mountains_of_Sabah'
UNION ALL select page_title, concat( cat_tree, "→", page_title ), categorylinks.cl_from, categorylinks.cl_type
FROM cats INNER JOIN page ON cats.cl_from = page_id
INNER JOIN categorylinks ON page_title = categorylinks.cl_to
)
SELECT replace( cat_tree, '_', ' ' ) 'category tree', replace( page_title, '_', ' ' ) 'File name' FROM cats INNER JOIN page ON page_id = cl_from WHERE cl_type = 'file';
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.