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

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

translate(string text, from text, to text)

描述:把在string中包含的任何匹配from中字符的字符转化为对应的在to中的字符。如果from比to长,删掉在from中出现的额外的字符。

返回值类型:text

示例:

12345
SELECT translate('12345', '143', 'ax'); translate----------- a2x5(1 row)
support.huaweicloud.com/sqlreference-910-dws/dws_06_0030.html