REPLACE(Lakehouse v1)
返回将字符串 str 中所有出现的字符串 from_str 替换为字符串 to_str 后的字符串。
Analyze 语法
Section titled “Analyze 语法”func.replace(<str>, <from_str>, <to_str>)Analyze 示例
Section titled “Analyze 示例”func.replace(<str>, <from_str>, <to_str>)┌──────────────────────────────────────┐│ func.replace('plaidCloud', 'p', 'P') │├──────────────────────────────────────┤│ PlaidCloud │└──────────────────────────────────────┘SQL 语法
Section titled “SQL 语法”REPLACE(<str>, <from_str>, <to_str>)| 参数 | 说明 |
|---|---|
<str> |
字符串。 |
<from_str> |
源字符串。 |
<to_str> |
目标字符串。 |
VARCHAR
SQL 示例
Section titled “SQL 示例”SELECT REPLACE('www.mysql.com', 'w', 'Ww');┌─────────────────────────────────────┐│ REPLACE('www.mysql.com', 'w', 'Ww') │├─────────────────────────────────────┤│ WwWwWw.mysql.com │└─────────────────────────────────────┘