您可以链接REPLACe函数:
select replace(replace('hello world','world','earth'),'hello','hi')
这将打印
hi earth。
您甚至可以使用子查询来替换多个字符串!
select replace(london_english,'hello','hi') as warwickshire_englishfrom ( select replace('hello world','world','earth') as london_english) sub
或使用JOIN替换它们:
select group_concat(newword separator ' ')from ( select 'hello' as oldword union all select 'world') originner join ( select 'hello' as oldword, 'hi' as newword union all select 'world', 'earth') trans on orig.oldword = trans.oldword
我将使用常见的表表达式来进行翻译,作为读者的练习;)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)