From: Tom Lane <tgl@sss.pgh.pa.us>
To: Charlie Clark <charlie@begeistert.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem with JOINS
Date: Fri, 21 May 2004 11:05:28 -0400
Message-ID: <3687.1085151928@sss.pgh.pa.us> (raw)
In-Reply-To: <20040521092834.1149.5@wonderland.1085121408.fake>
References: <20040521092834.1149.5@wonderland.1085121408.fake>
Charlie Clark <charlie@begeistert.org> writes:
> WHERE true
> AND
> person.id_status = 2
> AND
> person.id_authorise = 2
> AND
> ltrim(lower(address.ort)) like lower('Neuss%')
> AND
> bs.value = 'bezahlt' OR bs.value = 'erlassen'
> AND
> users.roles like '%Premium'
AND binds more tightly than OR --- I suspect you wanted some
parentheses.
AND
(bs.value = 'bezahlt' OR bs.value = 'erlassen')
AND
Or you could express the same thing using IN:
AND
bs.value IN ('bezahlt', 'erlassen')
AND
regards, tom lane
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: tgl@sss.pgh.pa.us, charlie@begeistert.org
Subject: Re: Problem with JOINS
In-Reply-To: <3687.1085151928@sss.pgh.pa.us>
* 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