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
What is data types in sql?
What is column?
Is foreign key mandatory?
Why do we need a foreign key?
How many types of cursors are available in pl/sql?
What is the use of <> sql?
What is the difference between left outer join and left join?
Explain what is table in a database?
How do I run a program in pl sql?
How can one get sql*loader to commit only at the end of the load file? : aql loader
what is a unique key ? : Sql dba
Which is better cte or subquery?
how to extract a unit value from a date and time? : Sql dba
Explain the difference between cursor declared in procedures and cursors declared in the package specification?
what are the features and advantages of object-oriented programming? : Sql dba