Searching for phone numbers in mysql

后端 未结 16 2323
耶瑟儿~
耶瑟儿~ 2020-12-30 06:40

I have a table which is full of arbitrarily formatted phone numbers, like this

027 123 5644
021 393-5593
(07) 123 456
042123456

I need to sea

16条回答
  •  说谎
    说谎 (楼主)
    2020-12-30 07:02

    An out-of-the-box idea, but could you use a "replace" function to strip out any instances of "(", "-" and " ", and then use an "isnumeric" function to test whether the resulting string is a number?

    Then you could do the same to the phone number string you're searching for and compare them as integers.

    Of course, this won't work for numbers like 1800-MATT-ROCKS. :)

提交回复
热议问题