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
How do I trace sql profiler?
What is sql key?
What is lookup table in sql?
What is the difference between partitioning and sharding?
what is the use of friend function? : Sql dba
In pl/sql, what is bulk binding, and when/how would it help performance?
Can a view be mutating? If yes, then how?
How do you create a db file?
What are the indexing methods?
What is an implicit commit?
what are the differences between binary and varbinary? : Sql dba
How to return multiple rows from the stored procedure?
What is compilation error in pl sql?
What will you get by the cursor attribute sql%notfound?
Why do we need unique key in a table?