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
Define tables and fields in a database
What is the difference between microsoft access and sql server?
Why function is used in sql?
what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql
what are numeric data types? : Sql dba
what are all the different normalizations? : Sql dba
What are the two types of exceptions in pl/sql?
Is primary key is clustered index?
What is rowtype?
Will truncate release space?
What is a data definition language?
name 3 ways to get an accurate count of the number of records in a table? : Sql dba
what are the authentication modes in sql server? How can it be changed? : Sql dba
What is scalar and vector?
Explain the commit statement.