Re: Difference between ON and WHERE in JOINs - Mailing list pgsql-general

From Jean-Christophe Boggio
Subject Re: Difference between ON and WHERE in JOINs
Date
Msg-id 5059E743.5070204@thefreecat.org
Whole thread Raw
In response to Re: Difference between ON and WHERE in JOINs  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Le 19/09/2012 17:08, Merlin Moncure a écrit :
> SELECT * FROM foo LEFT JOIN BAR ON foo.id = bar.id AND bar.col = 'something';
>
> The difference here is that the filtering is now happening at join
> time where the left join semantics are playing: always return foo and
> return bar rows if and only if the join condition is met.

Ok, as a rule of thumb, should I put in the where clause only the
conditions related to foo and inner joins ? All other (outer) conditions
should then go on their respective 'ON' clauses ?

JC


pgsql-general by date:

Previous
From: Jean-Christophe Boggio
Date:
Subject: Re: Difference between ON and WHERE in JOINs
Next
From: Robert Sosinski
Date:
Subject: Re: Time-based trigger