I have a string in a table column delimited by '+'. I need to remove the duplicates.
Illustration :
My data:
a+a+a+b+b+c+c
Expectation:
a+b+c
I tried with REGEXP_REPLACE
but not able to escape the +
character as it is reserved.
I am successful with comma
separated value but need help with +
or ?
separated values.
Working Code with comma
separated value:
SELECT REGEXP_REPLACE ('a,a,a,b,b,c,c', '([^,]+)(,\1)+', '\1') FROM DUAL;