Library Functions [message #20300] |
Sun, 12 May 2002 08:43 |
Mark
Messages: 284 Registered: July 1998
|
Senior Member |
|
|
select btitle, SUBSTR(rpad(SUBSTR(btitle,INSTR(btitle||' ',' ',2,1),1),instr(btitle||' ',' ',1,1)),1,INSTR(btitle||' ',' ',1,1)) from book;
I'm tring to capture the second word only
btitle: I'm using a trailing blank (btitle||' ',)so that the instr can look for that space due to the varchar2 leaving no trailing spaces.
i.e Evil Under the Sun
needed results = "Under"
my results(with code above)
Unde
and,
A Guide to SQLA
G
This code works with these titles:
First Among Equals
Among
and this,
Ghost from the Grand Banks
from
any good suggestions on Library functions to use or logic thanks,
Mark
|
|
|
Re: Library Functions [message #20301 is a reply to message #20300] |
Sun, 12 May 2002 08:56 |
Mark
Messages: 284 Registered: July 1998
|
Senior Member |
|
|
select btitle, SUBSTR(rpad(SUBSTR(btitle,INSTR(btitle||' ',' ',2,1)),instr(btitle||' ',' ',1,1)),1,INSTR(btitle||' ',' ',1,1)) from book;
sorry this is the code that I'm using
no ),1)
|
|
|