Fork of Uncategorized categories (zhwiki_p) by Tjmj
This query is marked as a draft This query has been published by Enhancing999.

SQL

x
 
/** Test 
stats
Executed in 1344.80 seconds as of Sun, 25 Aug 2024 10:02:17 UTC: 1038 rows
Executed in 722.72 seconds as of Sun, 25 Aug 2024 11:49:41 UTC: 995 rows
**/
SELECT 
 page_title as category, 
 cat_pages as cat_size, 
 page_len as text_size, 
 actor_name as last_user, 
 left(rev_timestamp,12) as last_edit, 
 length(page_title) as len_name, 
 page_is_new as is_new, 
 pp_value as wikidata, 
 page_id 
FROM page_props
RIGHT JOIN (
  
SELECT
  page_title,
  page_len,
  cat_pages, 
  rev_timestamp, page_is_new, 
  actor_name, page_id
FROM
  revision
  JOIN actor ON rev_actor = actor_id
  JOIN (
    SELECT
      page_id,
      page_title,
      page_len, page_is_new, 
      cat_pages
    FROM
      category
      RIGHT JOIN page ON cat_title = page_title
      LEFT JOIN categorylinks ON page_id = cl_from
    WHERE
      cl_from IS NULL
      AND page_namespace = 14
      AND page_is_redirect = 0
    LIMIT 2000
  ) AS pagetmp ON rev_page = pagetmp.page_id
  AND rev_timestamp = (
    SELECT
      MAX(rev_timestamp)
    FROM
      revision AS last
    WHERE
      last.rev_page = pagetmp.page_id
  )
) AS pagetmp2 ON pp_page = pagetmp2.page_id
AND pp_propname='wikibase_item'
ORDER BY page_id 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.

Checking query status...