Oracle PL/SQL : remove “space characters” from a string

后端 未结 6 1841
迷失自我
迷失自我 2021-02-02 10:48

In my Oracle 10g database I would like to remove \"space characters\" (spaces, tabs, carriage returns...) from the values of a table field.

Is TRANSLATE() t

6条回答
  •  既然无缘
    2021-02-02 11:38

    To replace one or more white space characters by a single blank you should use {2,} instead of *, otherwise you would insert a blank between all non-blank characters.

    REGEXP_REPLACE( my_value, '[[:space:]]{2,}', ' ' )
    

提交回复
热议问题