Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5E0F9B5DBCA for ; Mon, 4 Jul 2011 10:59:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 22865-07 for ; Mon, 4 Jul 2011 13:59:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id 1D0E1B5D8C5 for ; Mon, 4 Jul 2011 10:59:50 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Qdjgj-00027d-5W for pgsql-sql@postgresql.org; Mon, 04 Jul 2011 06:59:49 -0700 Date: Mon, 4 Jul 2011 06:59:49 -0700 (PDT) From: gmb To: pgsql-sql@postgresql.org Message-ID: <1309787989162-4550092.post@n5.nabble.com> In-Reply-To: <868vseduyv.fsf@mgm.protecting.net> References: <1309762075448-4549140.post@n5.nabble.com> <868vseduyv.fsf@mgm.protecting.net> Subject: Re: Usage of function retruning record in query MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.767 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201107/3 X-Sequence-Number: 35573 Harald Fuchs-10 wrote: > In article <1309762075448-4549140.post@n5.nabble.com>,gmb > <gmbouwer@gmail.com> writes: > SELECT itemid, (calcvalues(itemid)).* FROM itemlist > Thanks for the feedback, Harald. How about specifying different aliases to the resulting values? This will be handy when I use the same function multiple times in the same query. (the function will take another input parameters used in the calculations) E.g.: SELECT itemid, (calcvalues(itemid, '2011-06-06')).*, (calcvalues(itemid, '2011-06-07')).* FROM itemlist; itemid | calcval1 | calcval2 | calcval1 | calcval2 --------+----------+----------+----------+---------- 4 | 0.67 | 10.00 | 0.64 | 65.23 5 | 1.55 | 45.00 | 1.23 | 23.25 6 | 3.60 | 69.00 | 2.98 | 62.66 How will I manage unique column names for this output? -- View this message in context: http://postgresql.1045698.n5.nabble.com/Usage-of-function-retruning-record-in-query-tp4549140p4550092.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.