Martin Jenkins <[EMAIL PROTECTED]> wrote:
> 
> I think you said that you generate the queries? If so, do you have to 
> nest so many nested ORs? I'm no SQL expert but
> 
> .... AND  ( Customer.FullName in (
>       'Amazon.com.ksdc, Inc. - Campbellsville',
      [...]
>       'Okami2',
>       'Quickspice, Inc.'))
>    )
> 
> appears to do the same job and a quick test suggests that it does. I 
> don't [know] what limits (if any) there would be with this approach but I 
> suspect Dr Hipp would rather you fix your SQL generator than have to 
> "fix" his parser. ;)
> 

The query optimizer will convert expressions of the form

    (a=V1 or a=V2 or a=V3 ... or a=VN)

Into

    (a IN (V1,V2,V3,...,VN))

So you should get the identical result regardless of which
input syntax you use.  The query optimizer makes this change,
by the way, because the second form is able to use an index
on the "a" column whereas the first form is not.

Oh, and Martin's suspicions about my preferences are correct :-)

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to