using Substr and Instr together
750906Jun 27 2010 — edited Jun 28 2010Hi All,
I have a string like 'Employee_id,employee_name,employee_ssn,employee_ps'
I would like to extract all the four columns individually in a single statement.
For ex:
select SUBSTR('Employee_id,employee_name,employee_ssn,employee_ps',1,
INSTR('Employee_id,employee_name,employee_ssn,employee_ps',',',1,1)-1) from dual;
this gives me Employee_id. The same way how do i get the other coulmn names by comma position.
Pls help me out.
Please note that the column names have to be extracted depending on the comma position.
Thanks.