SQL
AخA
SELECT CONCAT('#[[:File:', page_title, ']]') AS wikitext
FROM categorylinks
JOIN templatelinks ON tl_from = cl_from
JOIN page ON page_id = cl_from
WHERE cl_to LIKE 'All\_media\_needing\_categories\_as\_of%'
AND cl_type = 'file' AND page_namespace = 6
AND tl_namespace = 10 AND tl_title = 'Cs'
ORDER BY page_title;
/*
SELECT CONCAT('#[[:File:', files.page_title, ']]') AS wikitext
FROM categorylinks AS categories
JOIN page AS cat_page ON cat_page.page_id = categories.cl_from
JOIN categorylinks AS cl_files ON cl_files.cl_to = cat_page.page_title
JOIN templatelinks ON tl_from = cl_files.cl_from
JOIN page AS files ON files.page_id = cl_files.cl_from
WHERE categories.cl_to = 'Media_needing_categories'
AND categories.cl_type = 'subcat' AND cat_page.page_namespace = 14
AND cl_files.cl_type = 'file' AND files.page_namespace = 6
AND tl_namespace = 10 AND tl_title = 'Cs'
ORDER BY files.page_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.