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
Which sorts rows in sql?
What is pl sql in dbms?
What is the process of copying data from table a to table b?
Why cannot I use bind variables in ddl/scl statements in dynamic sql?
Which sql statement is used to delete data from a database?
What are the possible values that can be stored in a boolean data field?
Is inner join faster than left join?
How do you optimize a query?
What are the sql aggregate functions?
What is bulk collect in pl sql?
What is varchar example?
How much does sqlite cost?
What is the basic structure of an sql?
How do you rank data in sql?
What are the different types of functions in sql?