1

I have a table with ~200,000 rows. There are three different phone number columns and the data in them is not all formatted the same. I'd like to remove any value that is not a number and update every cell.

For instance, (412)641-5892 becomes 4126415892.

I found this STRIP_NON_DIGIT() function here. I can use that in my SQL queries and it works properly, but it takes a minute to return a result. I'd like to run a mass UPDATE across the entire table, but not sure what the syntax is for that.

Something like this is what I'm going for.

UPDATE leads 
SET phone    = STRIP_NON_DIGIT(phone), 
mobile_phone = STRIP_NON_DIGIT(mobile_phone), 
home_phone   = STRIP_NON_DIGIT(home_phone)
Community
  • 1
  • 1
Anthony Garand
  • 306
  • 3
  • 5
  • 16

1 Answers1

-1

Turns out the answer was the pseudo code that I wrote!

Anthony Garand
  • 306
  • 3
  • 5
  • 16