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 spool?
how to create a test table in your mysql server? : Sql dba
Is time a data type in sql?
what is the use of set statement in tsql? : Transact sql
Is it possible for a table to have more than one foreign key?
What is the difference between instead of trigger and after trigger?
Give the order of sql select?
What are the sql versions?
What is the use of sqlerrd 3?
What is the best sql course?
What are different types of indexes?
What is a native sql query?
How can I change database name in sql?
What is $$ in sql?
What are the differences between implicit and explicit cursors?