From: Scott Marlowe <smarlowe@g2switchworks.com>
To: KeithW@narrowpathinc.com
Cc: PostgreSQL SQL <pgsql-sql@postgresql.org>
Subject: Re: More efficient OR
Date: Wed, 16 Feb 2005 10:15:15 -0600
Message-ID: <1108570515.11967.223.camel@state.g2switchworks.com> (raw)
In-Reply-To: <20050216155901.M41773@narrowpathinc.com>
References: <20050216155901.M41773@narrowpathinc.com>
On Wed, 2005-02-16 at 10:02, Keith Worthington wrote:
> Hi All,
>
> In several of my SQL statements I have to use a WHERE clause that contains
> mutiple ORs. i.e.
>
> WHERE column1 = 'A' OR
> column1 = 'B' OR
> column1 = 'C'
>
> Is there a more efficient SQL statement that accomplishes the same limiting
> functionality?
The in() construct is (nowadays) basically the same as ORing multiple
columns;
where column1 in ('A','B','C')
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: smarlowe@g2switchworks.com, KeithW@narrowpathinc.com
Subject: Re: More efficient OR
In-Reply-To: <1108570515.11967.223.camel@state.g2switchworks.com>
* 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