Remove Duplicates From Comma Separated String
990568Feb 12 2013 — edited Feb 15 2013Hi,
I have one Column which contains duplicates values with comma separated.
Customer ID
-----------------------------
5,5,5,5,6,6,5,5,5,6,7,4,1,2,1,4,7,2
I wrote this:
select REGEXP_REPLACE('5,5,5,5,6,6,5,5,5,6,7,4,1,2,1,4,7,2', '(^|,)([^,]*)(,\2)+','\1\2') from dual;
---------------------------------
5,6,5,6,7,4,1,2,1,4,7,2
But it eliminates only continuous elements.
I want out put like:
---------------------
5,6,7,4,1,2
Please help.
Thanks.
Amit
Edited by: 987565 on Feb 12, 2013 4:02 AM