Skip to content
Advertisement

Remove special symbols from email string

I need to replace some characters in email string, exactly such actions:

But in SQL

I tried to use expression TRANSLATE(lower(email), 'a1_a.a-a@1-+()a ', 'a a a a'), but it didn’t give me solution.

Thanks in advance!

For example:

Advertisement

Answer

Which, for the sample data:

Outputs:

EMAIL TRANSLATED
some_email.example-2021@gmail.com some email example

db<>fiddle here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement