Fork of Wikimedia Commons media with Czech description needing categories by Matěj Suchánek
This query is marked as a draft This query has been published by ŠJů.

SQL

AخA
 
SELECT page_title FROM page
JOIN categorylinks ON cl_from = page_id
JOIN templatelinks ON tl_from = page_id
JOIN linktarget ON tl_target_id = lt_id
WHERE page_namespace = 6
AND cl_to IN (
  SELECT page_title FROM page
  JOIN categorylinks ON page_id = cl_from
  WHERE cl_to = 'Media_needing_categories'
) AND lt_namespace = 10
AND lt_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.

Checking query status...