I have a tablle like this.
cust acc
---------------
a 1
b 2|3
c 4|5|6

I Want below o/p:
cust acc
-----------
a 1
b 2
b 3
c 4
c 5
c 6
Please any one can you have any ideas share me.
I have urgent requirement.

Answer Posted / p deshmukh

SELECT distinct COL, trim(regexp_substr(colvalue, '[^|]+', 1, level)) colvalue
FROM (with demo as ( select '1' as a, '2|3' as b, '4|5|6' as c from dual )

select * from demo
unpivot
( colvalue for col in (a, b, c) )) t
CONNECT BY instr(colvalue, '|', 1, level - 1) > 0
order by col

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is rdbms? : Sql dba

667


What are hotfixes and patches?

619


What is set transaction?

678


What does select count (*) mean in sql?

633


What are types of indexes in sql?

637






What is a primary key? Explain

631


What is execute immediate?

634


What is sqlca in db2?

607


How long does it take to learn pl sql?

696


how to fetch common records from two tables? : Sql dba

737


Could you please provide oca (oracle 10g) dumps for my certification ?

4643


How many commands are in sql?

616


What are the uses of sysdate and user keywords?

732


What are character functions?

710


What does pl sql stand for?

746