SQL
x
USE zhwiki_p;
SELECT
page_id AS id,
CASE page_namespace - 1
WHEN 0 THEN ''
WHEN 2 THEN 'User'
WHEN 4 THEN 'Wikipedia'
WHEN 6 THEN 'File'
WHEN 8 THEN 'MediaWiki'
WHEN 10 THEN 'Template'
WHEN 12 THEN 'Help'
WHEN 14 THEN 'Category'
WHEN 100 THEN 'Portal'
WHEN 118 THEN 'Draft'
WHEN 828 THEN 'Module'
ELSE page_namespace - 1
END AS namespace,
page_title AS title,
page_is_redirect as is_redirect,
page_is_new as is_new,
page_len as len,
CONCAT(
'[[',
IF(page.page_namespace = 1, '', ':'),
'{{subst:ns:',
page.page_namespace - 1,
'}}:',
page.page_title,
"]]"
) AS pagelink
FROM
page
JOIN categorylinks ON cl_from = page_id
AND cl_type = 'page'
WHERE
cl_to = "电子游戏条目"
Limit
20;
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.