Re: is it possible to do this? have a subselect that returns

From: Ron <rstpierre(at)syscor(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: is it possible to do this? have a subselect that returns
Date: 2003-09-03 18:49:30
Message-ID: 3F5637BA.8050206@syscor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

see below....

Greg Stark wrote:

>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
>

SELECT x, y, z, SS.*
FROM tab, (SELECT a,b FROM foo) SS

>
>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.
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2003-09-03 18:59:48 Re: is it possible to do this? have a subselect that returns two columns
Previous Message Greg Stark 2003-09-03 18:47:35 Re: Localization (for dates) Oracle vs. Postgresql