Get Comma separate Values [message #569064] |
Fri, 19 October 2012 05:36 |
srinivas.k2005
Messages: 404 Registered: August 2006
|
Senior Member |
|
|
Hi,
I have one scenario here.
Create table a ( Objectid number, Value varchar2(2000);
/
Insert into a values (12, '2,3,4');
Insert into a values (13, '8,7,4');
Insert into a values (14, '3,8,9');
Insert into a values (15, '6,3,11');
I should get the output as:
ID Value
------ ------
12 2
12 3
12 4
13 8
13 7
13 4
14 3
14 8
14 9
15 6
15 3
15 11
Regards,
SRK
|
|
|
Re: Get Comma separate Values [message #569065 is a reply to message #569064] |
Fri, 19 October 2012 06:04 |
muralikri
Messages: 638 Registered: August 2011 Location: chennai
|
Senior Member |
|
|
Try like
SELECT distinct objectid, REGEXP_SUBSTR (value, '[^,]+', 1, LEVEL) pivot_char
FROM a CONNECT BY REGEXP_SUBSTR (value, '[^,]+', 1, LEVEL) IS NOT NULL
|
|
|
|
|
|
|
|