Removing nonnumerical data out of a number + SQL

前端 未结 5 1845
深忆病人
深忆病人 2021-01-21 06:06

I\'m trying find the best way to remove nonnumerical data from a varchar in SQL e.g.

\'(082) 000-0000\' to \'0820000000\' or
\'+2782 000 0000\' to \'0820000000\'         


        
5条回答
  •  一向
    一向 (楼主)
    2021-01-21 06:40

    What flavour of SQL backend are you using? If there's a regexp_replace kind of function, you could use that to replace [^0-9] with nothing.

提交回复
热议问题