Re: JOIN a UNION

Поиск
Список
Период
Сортировка
От david.schruth
Тема Re: JOIN a UNION
Дата
Msg-id a718dbdf-62e5-4f5e-8dff-91fbb219c638@y4g2000prf.googlegroups.com
обсуждение исходный текст
Ответ на JOIN a UNION  ("david.schruth" <dschruth@gmail.com>)
Ответы Re: JOIN a UNION
Список pgsql-general
I just realized what I posted was perfectly valid SQL. The following
is more what I had in mind:

(SELECT x,y,z FROM A
UNION
SELECT x,y,z FROM B)
AB JOIN C ON C.z = AB.z

This version certainly does throw an error.

Basically I'm wondering if there is a way to get Postgres to treat the
result of a UNION as a table on which I could perform subsequent
operations (like a JOIN).

On Aug 6, 10:43 am, "david.schruth" <dschr...@gmail.com> wrote:
> Simple question:
>
> Is there a way to do something like the following:
>
> SELECT x,y,z FROM A
> UNION
> SELECT x,y,z FROM B
> JOIN C ON C.z = B.z
>
> Thanks,
>
> Dave


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

Предыдущее
От: "david.schruth"
Дата:
Сообщение: JOIN a UNION
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Empty Updates, ON UPDATE triggers and Rules