Re: help with replacing OR in query

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Tue, 13 Aug 2002 03:25:21 GMT
Message-ID: <A__59.97079$sA3.42385_at_rwcrnsc52.ops.asp.att.net>


If you need OR then you gotta use OR. You could index both columns. create index myindex on table1(col2,col3); Jim
"Erick Papadakis" <erick_papadakis_at_yahoo.com> wrote in message news:737aefee.0208121626.578cf5b6_at_posting.google.com...
> p.s., if you reply, kindly CC me as well.
>
> hi, i have the following SQL query
>
> select col1 from table1
> where
> col2 = 'xxx' or col3 = 'xxx'
>
> how can i get rid of this OR? due to my table design and the logic
> involved, i have to check both these 2 columns (in a search function). i
> cannot concaneate them to make a third column because i need to check for
> exact match but for both the columns.
>
> so what can i do to replace the OR, because the OR makes the query skip
 any index.
>
> thanks in advance for any insight/ideas!
>
> .ep
Received on Tue Aug 13 2002 - 05:25:21 CEST

Original text of this message