REPLACE (Lakehouse v1)
Retorna a string str com todas as ocorrências da string from_str substituídas pela string to_str.
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.replace(<str>, <from_str>, <to_str>)Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.replace(<str>, <from_str>, <to_str>)┌──────────────────────────────────────┐│ func.replace('plaidCloud', 'p', 'P') │├──────────────────────────────────────┤│ PlaidCloud │└──────────────────────────────────────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”REPLACE(<str>, <from_str>, <to_str>)Argumentos
Seção intitulada “Argumentos”| Argumentos | Descrição |
|---|---|
<str> |
A string. |
<from_str> |
A string a ser substituída. |
<to_str> |
A string de substituição. |
Tipo de retorno
Seção intitulada “Tipo de retorno”VARCHAR
Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT REPLACE('www.mysql.com', 'w', 'Ww');┌─────────────────────────────────────┐│ REPLACE('www.mysql.com', 'w', 'Ww') │├─────────────────────────────────────┤│ WwWwWw.mysql.com │└─────────────────────────────────────┘