Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Harry Tuttle Newsgroups: comp.databases.postgresql Subject: Re: Returning a table in SQL Date: Thu, 28 Aug 2014 17:51:18 +0200 Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net oCmcq+wVlyURLsJ+3Jh1HA84QnOP/96/5xLYgJamg3OvTSHBg= Cancel-Lock: sha1:faX5i3IS9kP2ePWmugzPvnLMfIY= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: Xref: csiph.com comp.databases.postgresql:596 AP wrote on 27.08.2014 22:37: > Actually, I figured it out : > > with report as (select some_report('Customer','2014-08-01','2014-08-08') cr) > select > (cr).field1, > (cr).field2, > (cr).field3 > from report; > > gives three separated columns. > > WITH clause is for clarity solely > It's still "wrong". You should really put the function into the from clause. select * from some_report('Customer','2014-08-01','2014-08-08')