Re: Is it possible to left join based on previous joins result

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Is it possible to left join based on previous joins result
Дата
Msg-id 20060907072131.J60412@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Is it possible to left join based on previous joins result  (Emi Lu <emilu@encs.concordia.ca>)
Список pgsql-sql
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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Problem with FOR UPDATE
Следующее
От: Ragnar
Дата:
Сообщение: Re: Is it possible to left join based on previous joins