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
How many commands are there in sql?
Is a secondary key the same as a foreign key?
How you improve the performance of sql*loader? : aql loader
Why do we use procedures?
How many types of triggers exist in pl/sql?
What is sql lookup?
What is crud sql?
What is query execution plan in sql?
Can a commit statement be executed as part of a trigger?
How do I count rows in sql query?
What does the base_object_type column shows in the user.triggers data dictionary view?
what is a field in a database ? : Sql dba
How to run sql statements with oracle sql developer?
What is sql data?
Define concurrency control. : Transact sql