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

时间:2025-02-12 15:04:44

replace(string text, from text, to text)

描述:在字符串string中查找所有子字符串from的内容并将其替换为子字符串to的内容。

返回值类型:text

示例:

12345
SELECT replace('abcdefabcdef', 'cd', 'XXX');    replace     ---------------- abXXXefabXXXef(1 row)
support.huaweicloud.com/sqlreference-910-dws/dws_06_0030.html