Re: function with multiple return values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: function with multiple return values
Date: 2010-11-07 15:53:16
Message-ID: 27547.1289145196@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Kretschmer <akretschmer(at)spamfence(dot)net> writes:
> Scott Serr <serrs(at)theserrs(dot)net> wrote:
>> Ideas on how to uniquely name the first and second set of "perc,
>> entry_date"?

> You can use alias-names for the 2 queries, like:

> test=*# select foobar.a as x, foobar.b as y, bar.* from (select * from foo()) foobar, (select * from foo()) bar ;

You don't really need the sub-selects: you can put aliases on functions
in FROM.

select * from foo(...) as f1(a,b), foo(...) as f2(x,y);

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2010-11-07 16:19:41 Re: function with multiple return values
Previous Message Scott Ribe 2010-11-07 15:41:49 Re: It is possible to update more than 1 table in the same update statement?