| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to search on a column without using LIKE?
OraSaurus <granaman_at_phonet.com> wrote in article
<342b2b6a.0_at_iorich.phonet.com>...
> In article <3429282f.2199682_at_news.erols.com>, drippel_at_perspect.com wrote:
> >How about using the instr function
> >
> >where instr( org_name, 'stans' ) > 0
> >and instr( org_name, 'widgets' ) > 0
> >etc.
>
> The use of a function, like instr(), disallows the use of an index on
> org_name - resulting in a table scan.
>
Yes, but so does using '%' at the start of your pattern, like '%WIDGETS%'. 'STAN%' will use the index, but '%WIDGETS%' will not. So instr() is no better or worse a solution than LIKE. Received on Mon Sep 29 1997 - 00:00:00 CDT
![]() |
![]() |