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 exception handling is done in advance pl/sql?
What happens when a trigger is associated to a view?
What is sql comments?
When do we use triggers?
What is nvarchar max in sql?
How does sql store data?
What is primary key in db?
What is restrict in sql?
Why cross join is used?
What type of database is cloud sql?
What is an index? What are the types of indexes? How many clustered indexes can be created on a table?
What are the two types of exceptions.
Is subquery faster than join?
what are tables and fields? : Sql dba
What is sql performance tuning?