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

Can you upgrade sql express to full sql?

1043


What does stand for in sql?

951


Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

1194


What is the difference between clustered and non-clustered index in sql?

986


How to select random rows from a table?

1060


what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba

1041


What is difference between function and trigger?

1023


Can we use views in stored procedure?

1018


Can we create view in stored procedure?

943


how to drop an existing index in mysql? : Sql dba

1052


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

1022


how to shutdown mysql server? : Sql dba

1079


What is the need of a partition key?

969


How do I start pl sql?

931


Are views faster than queries?

974