Home » SQL & PL/SQL » SQL & PL/SQL » Using instr and substr
Using instr and substr [message #36563] Tue, 04 December 2001 14:08 Go to next message
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 Go to previous message
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

----------------------------------------------------------------------
Previous Topic: Format conversion +999,999,999.99
Next Topic: stored procedure
Goto Forum:
  


Current Time: Thu Mar 28 13:36:30 CDT 2024