Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...



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

Define tables and fields in a database

1177


What is the difference between microsoft access and sql server?

1107


Why function is used in sql?

992


what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql

1008


what are numeric data types? : Sql dba

1111


what are all the different normalizations? : Sql dba

1121


What are the two types of exceptions in pl/sql?

1091


Is primary key is clustered index?

1045


What is rowtype?

1080


Will truncate release space?

990


What is a data definition language?

1196


name 3 ways to get an accurate count of the number of records in a table? : Sql dba

1116


what are the authentication modes in sql server? How can it be changed? : Sql dba

1511


What is scalar and vector?

1061


Explain the commit statement.

1215