Re: oracle/sql "where clause"
Date: 1996/10/02
Message-ID: <52tugv$ao3_at_cyber2.servtech.com>#1/1
In <johnv.0a4n_at_acix.DIALix.oz.au> johnv_at_acix.DIALix.oz.au (John Verhoeven) writes:
>In article dated Thu, 26 Sep 1996 06:23:00 +0100, AMARENDRA B NETTEM (nettama_at_charlie.cns.iit.edu) wrote:
>> Paul Chow wrote:
>> > does anyone know whether one of the following two where clauses is more efficient
>> > than the other ...
>> >
>> > [1]. select ...
>> > from ...
>> > where (field_x='K' or field_x='L' or field_x='M')
>> >
>> > [2]. select ...
>> > from ...
>> > where field_x in ('K','L','M')
>> Second query is efficient than the first one. But make there are no NULL
>> value for that field when using IN operator.
>Nope. Neither is more efficient than the other.
>The second may be quicker for you to write, but the parser converts it
>into the first form for execution anyway.
>Do an explain plan on both queries and you will see that they are treated
>the same.