set @word = 'hello';
with recursive cte as (
select @word as word, left(@word, 1) as val, 1 as idx
union all
select word, substring(word, idx + 1, 1), idx + 1
from cte
where idx < char_length(word)
)
select group_concat(ascii(val) order by idx separator '') ascii_word from cte
1条答案
按热度按时间bqf10yzr1#
你想要什么
group_concat()
,不是concat()
-连同期权separator ''
.