pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Pradier <david.pradier@clarisys.fr>
To: pgsql-sql@postgresql.org
Subject: Order of precedence between AND and OR.
Date: Fri, 25 Nov 2005 17:52:59 +0100
Message-ID: <20051125165259.GE4482@clarisys.fr> (raw)

Hi everybody,

during the code inspection due to our migration to 8.1,
I found a piece of SQL code written like this :

WHERE a AND b OR c AND d

Now, I know that AND and OR are commutative because it's written in the
docs.
But what I couldn't find is if there is an order of precedence between
AND and OR, that is if the AND expression is calculated before the OR
one, or anyelse way.

Could somebody tell me or point me to the right doc ?

Thanks in advance,
David

-- 
David Pradier -- Directeur Technique de Clarisys Informatique -- Chef de projet logiciels libres / open-source



view thread (2+ messages)  latest in thread

Message-ID: <20051125165259.GE4482@clarisys.fr>
Permalink:  ../20051125165259.GE4482@clarisys.fr/
Also on:    postgresql.org/message-id/20051125165259.GE4482@clarisys.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: david.pradier@clarisys.fr
  Subject: Re: Order of precedence between AND and OR.
  In-Reply-To: <20051125165259.GE4482@clarisys.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox