is it possible to do this? have a subselect that returns two columns

Поиск
Список
Период
Сортировка
От Greg Stark
Тема is it possible to do this? have a subselect that returns two columns
Дата
Msg-id 87oey1d914.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответы Re: is it possible to do this? have a subselect that  (darren@crystalballinc.com)
Re: is it possible to do this? have a subselect that returns  (Ron <rstpierre@syscor.com>)
Список pgsql-general
So I have a query in which some of the select values are subqueries. The
subqueries are aggregates so I don't want to turn this into a join, it would
become too complex and postgres would have trouble optimizing things.

So my question is, is there some way to have a subselect return multiple
columns and break those out in the outer query?

Something like:

SELECT x,y,z,
       (SELECT a,b FROM foo) AS (sub_a,sub_b)
  FROM tab

I don't think it's possible but it would simplify my life a whole heck of a
lot if it was, so I figured I would double-check before tearing my hair out.

--
greg

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

Предыдущее
От: Terry Yapt
Дата:
Сообщение: Re: Oracle decode Function in Postgres
Следующее
От: Oliver Elphick
Дата:
Сообщение: Debian packages of 7.4beta2