Home » SQL & PL/SQL » SQL & PL/SQL » Comma Seperated String (merged)
Comma Seperated String (merged) [message #347522] Fri, 12 September 2008 00:21 Go to next message
someswar1
Messages: 53
Registered: January 2008
Member
I have a Comma seperated string source table like 21,72,51,54,102,101,105,121. I want to spilted a seperated rows. I am doing this in following coomad.

SELECT NVL (MSISDN, '0') SERVED_MSISDN,
REGEXP_SUBSTR (SERVICE_POINTER_SUD,'[^,]+', 1,LEVEL) AS HLR_SERVICE_ID_KEY,
REGEXP_SUBSTR (SUD, '[^,]+', 1, LEVEL) AS SERVICE_ID_VALUE
FROM (SELECT ROWNUM AS ID, IMSI, MSISDN, SERVICE_POINTER_SUD, SUD
FROM RW_CEL_TAN_ERIC_HLR_R12_1_SD where msisdn=255786096551)
CONNECT BY INSTR (SERVICE_POINTER_SUD, ',', 1, LEVEL - 1) > 0
AND ID = PRIOR ID AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL;

This code is working fine. But how I implement the logic if hlr_service_ID_key contains 15,19,105 and corresponding service_value is all cases r 1 then status key will be 3 particular subscriber. please Help


[mod-edit] BOLD removed to make it readable.

[Updated on: Tue, 16 September 2008 08:20] by Moderator

Report message to a moderator

Re: Comma Seperated String [message #347523 is a reply to message #347522] Fri, 12 September 2008 00:22 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines as stated in URL above


Re: Comma Seperated String [message #347528 is a reply to message #347522] Fri, 12 September 2008 00:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Ununderstandable.
From your previous topic:
Michel Cadot wrote on Tue, 03 June 2008 13:45
Read and FOLLOW OraFAQ Forum Guide.

Regards
Michel


Spliting the data in different rows [message #348202 is a reply to message #347522] Tue, 16 September 2008 00:32 Go to previous messageGo to next message
someswar1
Messages: 53
Registered: January 2008
Member
Hi,
I an createting a table
CREATE TABLE t
( str VARCHAR2(30) );

SQL> INSERT INTO t VALUES ( 'X,Y,Z' );

1 row created.
SQL> INSERT INTO t VALUES ( 'XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG' );
1 row created.

Can any one tell me how i spillting the value in different rows in sql statement oracle 10g. The source table has 4.5 m data.

please help.
Re: Spliting the data in different rows [message #348203 is a reply to message #348202] Tue, 16 September 2008 00:35 Go to previous message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Same answer as for your previous and identical post:
http://www.orafaq.com/forum/m/347522/102589/#msg_347522

Search this has been asked and answered many times.

Regards
Michel

[Edit: topics are now merged]

[Updated on: Tue, 16 September 2008 01:07]

Report message to a moderator

Previous Topic: query how to limit records output
Next Topic: WITH Clause with Full Outer Join
Goto Forum:
  


Current Time: Fri Dec 02 23:11:25 CST 2016

Total time taken to generate the page: 0.19523 seconds