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 the sql*loader? : aql loader

775


What are joins in sql?

719


What is package in pl sql with an examples?

728


What is file based approach?

663


Explain what is sql*plus?

855






what is myisam? : Sql dba

756


What are tables and fields in the database?

750


What are tables in sql?

738


Explain the savepoint statement.

812


What is the difference between an inner join and an outer join?

716


What are user defined functions?

759


Is sql a backend language?

842


How can you load microsoft excel data into oracle? : aql loader

811


Is nosql relational?

706


what are date and time data types? : Sql dba

699