Sam
Sam

Reputation: 59

SQL Data cleaning

I have a data set where I am trying to clean data. I want to remove the ** from email-address and phone_number and have just numbers in the phone_number column. how can i do it.

enter image description here

Upvotes: 0

Views: 167

Answers (1)

GMB
GMB

Reputation: 222462

Here is one option using string functions:

update mytable 
set email        = replace(email, '**', ''), 
    phone_number = regexp_replace(phone_number, '\\D', '')

This removes '**' from email, and all non-digit characters from phone_number.

Upvotes: 1

Related Questions