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


Please Help Members By Posting Answers For Below Questions

What is input buffer in sql*plus?

632


How many functions are there in sql?

530


What will you get by the cursor attribute sql%found?

530


Which constraints we can use while creating database in sql?

604


What is rank () in sql?

522






Why is there a need for sqlcode and sqlerrm variables?

576


What does 0 mean in sql?

522


Explain the insert into statements in sql?

555


Explain the difference in execution of triggers and stored procedures?

559


How does postgresql compare to mysql?

571


How to find 3rd highest salary of an employee from the employee table in sql?

560


What is an example of translating a date into julian format?

565


What do you mean by field in sql?

525


Is progress software supports to ( pl/sql )?

521


Are there any features that are decommissioned in 11g that are not present in 11g?

1580