From: Harald Fuchs <hari.fuchs@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: LEFT OUTER JOIN issue
Date: Wed, 21 Apr 2010 18:33:10 +0200
Message-ID: <puochcbwah.fsf@srv.protecting.net> (raw)
References: <5AF59BAE41BBA14090A31CE077580C53238EAB6FDB@EXCHANGE2007.netcenter.local>
<987929295D1345B5BCE249F42730CB82@marktestcr.marktest.pt>
In article <987929295D1345B5BCE249F42730CB82@marktestcr.marktest.pt>,
"Oliveiros" <oliveiros.cristina@marktest.pt> writes:
> Hi, Thomas.
> I believe it is because of your WHERE clause, which is filtering out the nulls
> from hp table.
> According to
> WHERE
> hp.poste_idposte = 275
> You only want registers that have hp.poste_idposte = 275, not the null ones.
Yes, the WHERE effectively turns the outer into an inner join, thus
removing rows from the right table. By moving the WHERE to the JOIN
condition, you get the result you expected.
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: hari.fuchs@gmail.com
Subject: Re: LEFT OUTER JOIN issue
In-Reply-To: <puochcbwah.fsf@srv.protecting.net>
* 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