How to get the unique characters from a string in Oracle?
Lets say I have a column with data
CCCXXXCCCCCCCCCCCCCCCCXXCCCCCCCCCCCCCCCCCCCCCCC
and I want to return 'CX' as the list of unique characters.
likewise: aaaabbbccccdddaaa ==> abcd , HelloO ==> HeloO
Order is important, I want them to be in the same order as they first appear in the string.
Is there any way to do it without using stored procedure?
Edit: add more examples
It returns
CXHere is another solution:
It returns all the unique chars in order of their occurence. Btw, yes, it looks horrible