How to strip all non-alphabetic characters from string in SQL Server?

后端 未结 18 1611
情深已故
情深已故 2020-11-21 23:49

How could you remove all characters that are not alphabetic from a string?

What about non-alphanumeric?

Does this have to be a custom function or are there

18条回答
  •  执笔经年
    2020-11-22 00:40

    I just found this built into Oracle 10g if that is what you're using. I had to strip all the special characters out for a phone number compare.

    regexp_replace(c.phone, '[^0-9]', '')
    

提交回复
热议问题