X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 6AE8530DF9F for ; Thu, 12 Jun 2003 12:24:58 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 58846-07 for ; Thu, 12 Jun 2003 09:24:47 -0300 (ADT) Received: from zenon.apartia.com (ATuileries-107-2-1-69.w217-128.abo.wanadoo.fr [217.128.120.69]) by svr1.postgresql.org (Postfix) with ESMTP id 9E10630D175 for ; Thu, 12 Jun 2003 09:24:47 -0300 (ADT) Received: from argos (argos.apartia.fr [10.0.2.105]) by zenon.apartia.com (Postfix) with ESMTP id E54279A570; Thu, 12 Jun 2003 14:24:47 +0200 (CEST) Received: by argos (Postfix, from userid 1018) id 4CAA9DDB7; Thu, 12 Jun 2003 14:24:46 +0200 (CEST) Date: Thu, 12 Jun 2003 14:24:46 +0200 From: David Pradier To: Christoph Haller Cc: pgsql-sql@postgresql.org Subject: Re: How to make a IN without a table... ? Message-ID: <20030612122446.GE680@apartia.fr> Mail-Followup-To: Christoph Haller , pgsql-sql@postgresql.org References: <3EE86D9D.BF6ECCA4@rodos.fzk.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EE86D9D.BF6ECCA4@rodos.fzk.de> User-Agent: Mutt/1.5.4i X-Archive-Number: 200306/107 X-Sequence-Number: 13865 On Thu, Jun 12, 2003 at 02:10:06PM +0200, Christoph Haller wrote: > > > > These values are not taken in a table, but put in directly. > > > > I guess i wasn't clear enough. > > "my_function" here is a function which calculate some results about > some > > datas from the database. > > Example : a function which would calculate the sum of the money (which > > > would be stored in the database by movement, ie amount + date + cause > + > > account) spent by user my_var1 during period my_var2. > > > I am not sure I'm getting it right. > The first statement suggests the data is coming from outside the > database. > The second suggests it is derived from the database though. > And now it sounds like you could use table functions. > Can you confirm that? > > Regards, Christoph The arguments of the functions come from outside the database, but the function itself uses the datas in the database. Like "Tell me how much i spent between the 4th and the 7th og this month ?" uses 4 and 7 as arguments, but need to fetch the datas in the database. Clear enough ? :-) What do you mean by table function ? Regards, David -- dpradier@apartia.fr 01.46.47.21.33