This query is marked as a draft This query has been published by Wargo.

SQL

x
 
WITH RECURSIVE subcategories(sbc_title, sbc_depth, sbc_id) AS (
  SELECT 'Informatyka', 0, 0 FROM DUAL
  UNION ALL
  SELECT page_title, sbc_depth+1, page_id FROM subcategories
  JOIN categorylinks ON cl_to = sbc_title
  JOIN page ON cl_from = page_id
  WHERE cl_type = "page"
  AND sbc_depth <= 3
)
         SELECT p.page_title, s.sbc_title
         FROM page p
         LEFT JOIN pagelinks l ON (l.pl_namespace = 0 AND l.pl_title = p.page_title)
         LEFT JOIN page_props prop ON (prop.pp_propname AND prop.pp_page = p.page_id)
            left join subcategories s on (s.sbc_id=p.page_id)
         WHERE
                 p.page_namespace = 0
                 AND page_is_redirect = 0
                 AND l.pl_namespace IS NULL
                 AND prop.pp_value IS NULL
                 AND s
         ORDER BY p.page_title ASC
LIMIT 10
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...