From: | Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> |
---|---|
To: | PgSQL General ML <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: is it possible to do this? have a subselect that |
Date: | 2003-09-03 20:45:59 |
Message-ID: | 1062621959.7341.385.camel@haggis |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, 2003-09-03 at 13:49, Ron wrote:
> 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
But where's the join between tab and foo? Wouldn't you then get
a combinatorial explosion?
--
-----------------------------------------------------------------
Ron Johnson, Jr. ron(dot)l(dot)johnson(at)cox(dot)net
Jefferson, LA USA
"Perl is worse than Python because people wanted it worse."
Larry Wall, 10/14/1998
From | Date | Subject | |
---|---|---|---|
Next Message | Marc G. Fournier | 2003-09-03 20:59:09 | Re: syntax error in eRServer.pm line 69 |
Previous Message | Bruce Momjian | 2003-09-03 20:43:28 | Re: CPAN, P for postgresql [Re: LAST_DAY Function in Postgres] |