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 / punith
SELECT a,
REGEXP_SUBSTR (b, '([^|]+)', 1, lvl) b
FROM dummy,
(SELECT LEVEL lvl
FROM (SELECT MAX (LENGTH (REGEXP_REPLACE
(b, '[^|]'))) mx
FROM dummy)
CONNECT BY LEVEL <= mx + 1)
WHERE lvl - 1 <= LENGTH (REGEXP_REPLACE (b, '[^|]'));
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
what is the difference between truncate and drop statements? : Sql dba
What are the possible values that can be stored in a boolean data field?
What is rank function in sql?
What are few of the schema objects that are created using PL/SQL?
What are pl/sql packages?
What is the least restrictive isolation level? : Transact sql
How does an execution block start and end in pl sql?
What is a relationship and what are they?
what tools available for managing mysql server? : Sql dba
Can we call stored procedure in function?
What are the differences between in and exists clause?
What is difference between group by and partition by?
In a distributed database system, can we execute two queries simultaneously?
what is heap table? : Sql dba
What are reports usually used for?