Re: What's wrong with this query? - Mailing list pgsql-general

From Tom Lane
Subject Re: What's wrong with this query?
Date
Msg-id 24836.1285165721@sss.pgh.pa.us
Whole thread Raw
In response to Re: What's wrong with this query?  (Mike Christensen <mike@kitchenpc.com>)
List pgsql-general
Mike Christensen <mike@kitchenpc.com> writes:
> So are you saying that a JOIN can only refer to itself and the last
> table on the FROM list?

Um, I think you've got the wrong mental model of the syntax.  JOIN
is a binary operation between two tables:

    tab1 JOIN tab2 ON some-condition-involving-tab1-and-tab2-only

You can nest these critters (ie, tab1 or tab2 could itself be a
JOIN construct), and you can write them as elements of a comma-separated
FROM list.  But the ON condition can never refer to anything outside
its JOIN construct.

            regards, tom lane

pgsql-general by date:

Previous
From: Lincoln Yeoh
Date:
Subject: Re: How about synchronous notifications?
Next
From:
Date:
Subject: Kill -9 for a session process caused all the sessions to be killed