Pular para o conteúdo

Retorna a string str com todas as ocorrências da string from_str substituídas pela string to_str.

func.replace(<str>, <from_str>, <to_str>)
func.replace(<str>, <from_str>, <to_str>)
┌──────────────────────────────────────┐
│ func.replace('plaidCloud', 'p', 'P') │
├──────────────────────────────────────┤
│ PlaidCloud │
└──────────────────────────────────────┘
REPLACE(<str>, <from_str>, <to_str>)
Argumentos Descrição
<str> A string.
<from_str> A string a ser substituída.
<to_str> A string de substituição.

VARCHAR

SELECT REPLACE('www.mysql.com', 'w', 'Ww');
┌─────────────────────────────────────┐
│ REPLACE('www.mysql.com', 'w', 'Ww') │
├─────────────────────────────────────┤
│ WwWwWw.mysql.com │
└─────────────────────────────────────┘