Re: SQL ... Order of operations with Logical Operators

From: FRAN <fran_beta_at_hotmail.com>
Date: 20 Jul 2006 01:02:46 -0700
Message-ID: <1153382566.253197.151690_at_h48g2000cwc.googlegroups.com>


Jay Dee wrote:
> FRAN wrote:
> > Can anyone advise how operations are treated when AND and OR are
> > combined?
> >
> > eg
> >
> > WHERE: Condition 1 > X AND Condition 2 < Y OR Condition 3 = Z
> >
> > Would the result of this query be to return results that
> >
> > a) Satisfied Condition 1 AND Condition 2 or alternatively, Condition 3
> > regarless of Conditions 1 AND 2
> >
> >
> > OR
> >
> > b) Condition 1 AND Condition 2 OR Condition 1 AND Condition 3
> >
> > Thanks
> >
> >
> > Fran
> >
>
>
> It depends. I thought this was nailed down long ago, but I was
> amazed to learn that there is a well-known product that decided
> to do things differently.
>

It wasn't "Access" was it?

> Generally, we think of AND as being "tighter" than OR. IOW,
> A AND B OR C is the same as (A AND B) OR C.

I see.

Thanks

Fran Received on Thu Jul 20 2006 - 10:02:46 CEST

Original text of this message