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

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

translate(string text, from text, to text)

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

返回值类型:text

示例:

1
2
3
4
5
SELECT translate('12345', '143', 'ax');
 translate
-----------
 a2x5
(1 row)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0030.html