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 record variable?
How does rowid help in running a query faster?
What is compound trigger?
How can I speed up sql query?
What is crud sql?
How do I upgrade sql?
Is id a reserved word in sql?
What is dbo in sql?
What are triggers in sql?
Is primary key is clustered index?
What are sql built in functions?
How to read xml file in oracle pl sql?
What is a record in a database?
discuss about myisam key cache. : Sql dba
How do you update a table in sql?