Using instr and substr [message #36563] |
Tue, 04 December 2001 14:08 |
ELK
Messages: 1 Registered: December 2001
|
Junior Member |
|
|
I have this string in a column named location
LOT 8 CONC3 RR
Using instr and substr, I want to take whatever value follows LOT and put it into a different column and whatever value follows CONC and put it into a different column.
----------------------------------------------------------------------
|
|
|
Re: Using instr and substr [message #36564 is a reply to message #36563] |
Tue, 04 December 2001 15:56 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
select substr('LOT 8 CONC3 RR',4,instr('LOT 8 CONC3 RR','CONC')-4) from dual;
select substr('LOT 8 CONC3 RR',-(length('LOT 8 CONC3 RR')-(instr('LOT 8 CONC3 RR','CONC')+3)))
from dual
----------------------------------------------------------------------
|
|
|