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 plvcmt and plvrb does in pl/sql?

874


Can we insert data into materialized view?

510


What is a function in oracle pl sql?

538


What is a rank in sql?

536


What are properties of the transaction?

557






What are different types of functions in sql?

511


What is the difference between join and natural join?

473


How to take user input in pl sql?

703


What are different joins used in sql?

552


Why truncate is faster than delete?

560


Name some usages of database trigger?

562


what does myisamchk do? : Sql dba

555


Sql technical questions

775


What is data manipulation language?

698


What is the difference between mdf and ndf files?

567