Exchange Tag for another SQL Tag

1

I have the following email: [email protected] , I need to change everything that has meusite.com.br to seusite.com.br .

How can I do it?

My idea was: UPDATE tabela SET email = email "seusite.com.br" .. But then it would not work, I would just add.

    
asked by anonymous 01.03.2018 / 18:47

2 answers

2

The following should be done:

UPDATE TABELA SET EMAIL = REPLACE(EMAIL,'meusite.com.br','seusite.com.br')
WHERE EMAIL like '%meusite.com.br'
    
01.03.2018 / 18:52
3

If it is SQL Server:

Update tabela
    set email = REPLACE(email, "meusite.com.br", "seusite.com.br")
Where email like '%meusite.com.br'
    
01.03.2018 / 18:52