From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Emi Lu <emilu@encs.concordia.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is it possible to left join based on previous joins result
Date: Thu, 7 Sep 2006 07:26:33 -0700 (PDT)
Message-ID: <20060907072131.J60412@megazone.bigpanda.com> (raw)
In-Reply-To: <45001AF6.4020706@encs.concordia.ca>
References: <45001AF6.4020706@encs.concordia.ca>
On Thu, 7 Sep 2006, Emi Lu wrote:
> Hello,
>
> Is it possible to do something like:
>
> select ...
> from t1
> inner join t2 ...
> left join t2.colN
>
> When t1 inner join with t2 I got unique result for t2.colN( colN's value
> is table name).
>
> Can I continue to left join with the column "colN" in table t2?
No, in part because it'd have to actually evaluate the first join in order
to even plan the remainder of the query. It might be possible to do
something similar, albeit somewhat slowly, inside a set returning
function, but you'd have to decide how to handle more than one row being
returned from the first join even if the value is unique, is that one join
against the table or multiple joins.
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: sszabo@megazone.bigpanda.com, emilu@encs.concordia.ca
Subject: Re: Is it possible to left join based on previous joins result
In-Reply-To: <20060907072131.J60412@megazone.bigpanda.com>
* 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