WITH x AS
(SELECT 0 AS id UNION ALL
SELECT id 1 AS id
FROM x
WHERE id < 9)
SELECT *
FROM x;
-- 生成连续字母(a-z)
WITH x AS
(SELECT 1 AS id UNION ALL
SELECT id 1 AS id
FROM x
WHERE id < 26)
SELECT CHAR(id 96) AS id
FROM x;
-- 生成连续字符(0-9,a-z)
WITH x AS
(SELECT 0 AS id,CHAR(ascii(‘0‘)) AS cc UNION ALL
SELECT id 1 AS id,CASE WHEN id<9 THEN CHAR(ascii(‘1‘) id) ELSE CHAR(ascii(‘a‘) id-9) END AS cc
FROM x
WHERE id < 35)
SELECT id, cc
FROM x;