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...

need to split a string into separate values.

eg.

col1 col2
----------
100 - 'a,b,c'
200 - 'a,x,d,e'
300 - 'c'

result:
value count
-------------
a - 2
b - 1
c - 2
etc.

Answer Posted / sharath sn

substr('a,b,c',',',instr('a,b,c',',',1,1)-1)
,substr('a,b,c',instr('a,b,c',',',1,1)+1,instr
('a,b,c',',',2,1)-instr('a,b,c',',',1,1)-1)
,substr('a,b,c',instr('a,b,c',',',2,1)-1);

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data types in sql?

1015


What is column?

1000


Is foreign key mandatory?

1013


Why do we need a foreign key?

1108


How many types of cursors are available in pl/sql?

1117


What is the use of <> sql?

985


What is the difference between left outer join and left join?

1002


Explain what is table in a database?

1069


How do I run a program in pl sql?

1011


How can one get sql*loader to commit only at the end of the load file? : aql loader

1068


what is a unique key ? : Sql dba

1102


Which is better cte or subquery?

1035


how to extract a unit value from a date and time? : Sql dba

998


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

1173


what are the features and advantages of object-oriented programming? : Sql dba

1022