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 consistency?
Mention what are different methods to trace the pl/sql code?
what is “go” in t-sql? : Transact sql
How to use sql statements in pl/sql?
Does db2 use sql?
How do you declare a variable in pl sql?
What is sql and how does it work?
What is the difference between drop and truncate commands?
What is the difference between sql, mysql and sql server?
Explain spool.
What is composite primary key in sql?
Is there a way to automate sql execution from the command-line, batch job or shell script?
What is the process of copying data from table a to table b?
can sql servers linked to other servers like oracle? : Sql dba
What is difference between mysql and postgresql?