Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Using instr in substr more than once

Using instr in substr more than once

From: Leanne Gleitz <leanne.gleitz_at_anthem.com>
Date: 20 Feb 2002 06:16:55 -0800
Message-ID: <2a73161c.0202200616.15c95f37@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US