Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL: Combine LIKE and IN statement?
Bob <no_at_mail.com> wrote in message news:<sBuWb.531553$_x2.1127068_at_zonnet-reader-1>...
> Can anyone tell me how to improve the following:
>
> Select tbl.city
> From tbl
> Where tbl.city like 'B%' or
> tbl.city like 'G%' or
> tbl.city like 'R%'
>
> I was trying:
> Where tbl.city like in ('B%', 'G%', 'R%')
> But apparently this is not the right way.
>
>
> Thanx,
> Bob
Bob, is there an index on the city column? How about posting the explain plan for the statement so we can see how Oracle choose to solve the query? Are your running cost or rule based? Are the statistics current? etc....
HTH -- Mark D Powell -- Received on Wed Feb 11 2004 - 20:00:27 CST
![]() |
![]() |