首页 > 解决方案 > 对于此服务器版本,“with”在此位置无效,需要标识符

问题描述

我有这个触发器,它在我的本地主机中运行良好,但是当我想将它部署到服务器时,它给了我这个错误。(“with”对于这个服务器版本在这个位置无效,需要一个标识符。)知道如何摆脱这个吗?

with recursive cte as (
    select name as name, left(name, 1) as val, 1 as idx
    union all
    select name, substring(name, idx + 1, 1), idx + 1 
    from cte 
    where idx < char_length(name)
)
select group_concat(ascii(val)  order by idx separator '') ascii_word from cte into result;

所以 name 是一个字符串。它需要将字符串转换为字符 - ascii 字符,然后在最后合并。

标签: mysqldatabaserecursionsyntaxtriggers

解决方案


推荐阅读