Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Using instr in substr more than once
I have some data set up in the following manner :
12345*67*8
9876*54
456
Is there any way to use a simple select to pull out the data into three separate columns :
12345 67 8
9876 54
456
I have tried the following:
select substr(data,1,instr(data,'*')-1)
,substr(data,instr(data,'*')+1,instr(data,'*',1,2))
from data_table
but this doesn't seem to work at getting the first 2 separated out.
For example the first one is returning
12345 67*8
Help! Thanks in advance! Received on Wed Feb 20 2002 - 08:16:55 CST
![]() |
![]() |