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 rename in sql?
How do sql databases work?
What is a string data type in sql?
What is string join?
How many triggers can be applied on a table?
Where is pl sql used?
What is an index in sql with example?
Are null values same as that of zero or a blank space?
Can we use ddl statements in stored procedure sql server?
How do you write a subquery?
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
Advantages and disadvantages of stored procedure?
Explain the significance of the & and && operators in pl sql.
List different type of expressions with the example.
Does access use sql?