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 / p deshmukh

SELECT distinct COL, trim(regexp_substr(colvalue, '[^|]+', 1, level)) colvalue
FROM (with demo as ( select '1' as a, '2|3' as b, '4|5|6' as c from dual )

select * from demo
unpivot
( colvalue for col in (a, b, c) )) t
CONNECT BY instr(colvalue, '|', 1, level - 1) > 0
order by col

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does a primary key have to be a number?

1003


Is primary key always clustered index?

1064


What are local and global variables and their differences?

1141


How can I tell if sql is running?

1133


What is the source code of a program?

1120


what is sub-query? : Transact sql

1161


what is 'mysqlimport'? : Sql dba

1112


Explain the difference between cursor declared in procedures and cursors declared in the package specification?

1224


How many types of indexes are there in sql?

1042


What is sql exception?

1012


Can one improve the performance of sql*loader? : aql loader

1099


what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

1124


How to run sql functions in pl/sql?

1123


What do you think about pl/sql?

1125


How to make a copy values from one column to another in sql?

1083