Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL function for last index
"agis" <stag_at_hq.acn.gr> schrieb im Newsbeitrag
news:cjts12$ma5$1_at_ulysses.noc.ntua.gr...
>
> "Marcel Stör" <marcel_at_frightanic.com> wrote in message
> news:1096967036.464748_at_fuchs.cyberlink.ch...
> > Hi,
> >
> > How do I find the last index (last occurrence) of a substring in a
string
> > using Oracle SQL? Sort of the opposite of the INSTR function that finds
> > the
> > *first* occurrence...
> >
> > Regards,
> > Marcel
> >
>
> You can test with this
>
> select instr('asgisj','s',-1) from dual;
> retruns 5
Thanks! It just realized that it's even in the docs: "If position is negative, Oracle counts and searches backward from the end of string."
Regards,
Marcel
Received on Tue Oct 05 2004 - 05:34:31 CDT
![]() |
![]() |