I have a table of email addresses:
CREATE TABLE contacts(
email VARCHAR(255)
)
INSERT INTO contacts VALUES
('[email protected]'),
('[email protected]'),
('[email protected]');
How can I find and replace the email format so [email protected]
-> [email protected]
?
E.g:
UPDATE contacts
SET email = REGEXP_REPLACE(email, '@', '@test.com');
Results in [email protected]
Playground here: https://dbfiddle.uk/GnIfomiO