Re: Left outer join with WHERE clause? - Mailing list pgsql-sql

From Dan Langille
Subject Re: Left outer join with WHERE clause?
Date
Msg-id 20020328130950.481C03F2D@bast.unixathome.org
Whole thread Raw
In response to Left outer join with WHERE clause?  (DI Hasenöhrl <i.hasenoehrl@aon.at>)
List pgsql-sql
On 28 Mar 2002 at 13:58, DI Hasenöhrl wrote:

> It doesn't work too:            LEFT JOIN (vartikellieferantbez ON
> artikel.a_nr = vartikellieferantbez.a_nr WHERE
> ((vartikellieferantbez.f_nr)=1)

Your "where" clause for an OUTER JOIN is actually the ON statement.  So do this:

LEFT JOIN (vartikellieferantbez ON (artikel.a_nr = vartikellieferantbez.a_nr  AND
vartikellieferantbez.f_nr = 1))



pgsql-sql by date:

Previous
From: Marie Tuite
Date:
Subject: procedure support in 7.2
Next
From: Gordon Clarke
Date:
Subject: Upgrading PostgreSQL to 7.1.3