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 / kavitha nedigunta
create table test001 (cuss varchar2(10), acc varchar2(30));
insert into test001 values ('a','1');
insert into test001 values ('b','2|3');
insert into test001 values ('c','4|5|6');
WITH CTE AS (SELECT CUSS,ACC FROM TEST001)
select distinct trim(regexp_substr( acc, '[^|]+', 1,
level)) acc ,cuss from cte
CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(ACC, '[^|]+')) +
1;
Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is input buffer in sql*plus?
How many functions are there in sql?
What will you get by the cursor attribute sql%found?
Which constraints we can use while creating database in sql?
What is rank () in sql?
Why is there a need for sqlcode and sqlerrm variables?
What does 0 mean in sql?
Explain the insert into statements in sql?
Explain the difference in execution of triggers and stored procedures?
How does postgresql compare to mysql?
How to find 3rd highest salary of an employee from the employee table in sql?
What is an example of translating a date into julian format?
What do you mean by field in sql?
Is progress software supports to ( pl/sql )?
Are there any features that are decommissioned in 11g that are not present in 11g?