Wednesday 27 November 2013

Remove special characters from string in SQL

Using  regexp_replace function we can remove all special characters in sql.

Ex : This is/Anil@Maguluri

In the above string we have two extra characters /@

select regexp_replace('This is/Anil@Maguluri', '( *[[:punct:]])', ' ') test_string from dual;

result : This is Anil Maguluri

No comments:

Post a Comment