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
Can we rollback truncate?
what is primary key? : Sql dba
What is the difference between inner join and outer join?
What is sql basics?
how to rename an existing table in mysql? : Sql dba
Name three sql operations that perform a sort.
how many triggers are allowed in mysql table? : Sql dba
What is materialized view. What are different methods of refresh?
Can a primary key be a foreign key?
What are different types of statements supported by sql?
What is cartesian join in sql?
what is sub-query? : Transact sql
What is normalization in sql?
describe transaction-safe table types in mysql : sql dba
What is t-sql? : Transact sql