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
How much ram can sql express use?
How to place comments in pl/sql?
What mean sql?
How to use boolean type in select statement?
What are different types of triggers?
what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba
How to use sql statements in pl/sql?
Explain what is a database?
What are the two types of exceptions.
What is the difference between cross join and natural join?
List the different type of joins?
Will truncate release space?
Is sqlite good enough for production?
what is foreign key? : Sql dba
How do I write a cron which will run a sql query and mail the results to agroup?