Hi Hugo,
I've modified your query a bit. Is this the desired result?
WITH temp1 (code, st, en) AS
(
SELECT 1027, '1', '4'
UNION ALL
SELECT 2562, 'a', 'c'
UNION ALL
SELECT 2564, '1', '3'
UNION ALL
SELECT 6663, 'a', 'c'
UNION ALL
SELECT 7426, 'a', 'd'
),
temp2 (code, ltr, s) AS
(
SELECT * FROM temp1
UNION ALL
SELECT code, CHR(ASCII(ltr) + 1), s FROM temp2 WHERE ltr < s
)
SELECT code, ltr FROM temp2;
------------------------------
SangGyu Jeong
Software Engineer
Infrasoft
Seoul Korea, Republic of
------------------------------