数据仓库服务 GAUSSDB(DWS)-字符处理函数和操作符:replace(string text, from text, to text)

时间:2024-04-18 16:25:14

replace(string text, from text, to text)

描述:把字符串string里出现地所有子字符串from的内容替换成子字符串to的内容。

返回值类型:text

示例:

1
2
3
4
5
SELECT replace('abcdefabcdef', 'cd', 'XXX');
    replace     
----------------
 abXXXefabXXXef
(1 row)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0030.html