Home » SQL & PL/SQL » SQL & PL/SQL » i want to select followinf word using substr and instr
i want to select followinf word using substr and instr [message #39498] Fri, 19 July 2002 09:04 Go to next message
rashme
Messages: 7
Registered: July 2002
Junior Member
i have a table in which i have only one colum that is
('hi,friends,this,is,rashme') in this i want to select (this) using substr and instr so please let me know how can i do this

thanks in advance
rashme333
Re: i want to select followinf word using substr and instr [message #39500 is a reply to message #39498] Fri, 19 July 2002 09:10 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
sql>select c, 
  2         substr(c, instr(c, ',', 1, 2) + 1, 
  3                   instr(c, ',', 1, 3) - instr(c, ',', 1, 2) - 1 ) this
  4    from t;
 
C
--------------------------------------------------
THIS
--------------------------------------------------
hi,friends,this,is,rashme
this
Re: i want to select followinf word using substr and instr [message #39539 is a reply to message #39498] Mon, 22 July 2002 22:09 Go to previous message
chandra
Messages: 31
Registered: October 2000
Member
declare
v_temp varchar(40) := 'hi,friends,this,is,rashme' ;
begin
dbms_output.put_line(substr(v_temp,instr(v_temp,'this'),4));
end;
Previous Topic: problem with procedure error
Next Topic: Duplicate rows
Goto Forum:
  


Current Time: Fri Apr 26 14:57:37 CDT 2024