Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 41A4D9FC01A; Thu, 21 Jun 2007 10:24:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 71834-02; Thu, 21 Jun 2007 10:24:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by postgresql.org (Postfix) with ESMTP id E92F09FBFFD; Thu, 21 Jun 2007 10:24:42 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1I1MeO3ZQg-0002iw; Thu, 21 Jun 2007 15:24:41 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1I1MeO-0004BJ-00; Thu, 21 Jun 2007 15:24:40 +0200 Date: Thu, 21 Jun 2007 15:24:40 +0200 From: "A. Kretschmer" To: pgsql-novice@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] Select last there dates Message-ID: <20070621132440.GM1405@a-kretschmer.de> References: <1c23c8e70706210118h6b9490e3s11e2a6ba15cdff6c@mail.gmail.com> <20070621095025.GG1405@a-kretschmer.de> <1c23c8e70706210600he74293ci83bdbc557ee2dba8@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c23c8e70706210600he74293ci83bdbc557ee2dba8@mail.gmail.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX1+sm7r2EYetu3cYd/dtFCnKw9lVnsrOF5X7TRz Wky7mXD92yf5PYXCI7M5tydcSzYnSdphlAHfvpthaSwi9TMkxG +uduhgxC9oLzF3nAK1q0N+Sif3vkkCx X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/149 X-Sequence-Number: 19047 am Thu, dem 21.06.2007, um 16:00:05 +0300 mailte Loredana Curugiu folgendes: > So Andreas, would you please give some more explanations > on your solution? I didn't work with functions and aggregate till > now. I will try it, but i'm not a nativ english speaker and thats why i have some problems... > > I don't understand how this comma_aggregate works. I can see that this > function it is defined with two arguments, but the aggredate it is called > with a single argument. An aggregate needs among others a so called 'SFUNC' with 2 parameters: internal-state and next data item. It returns the next-internal-state. This is explained here: http://www.postgresql.org/docs/8.1/interactive/sql-createaggregate.html > > And what is LANGUAGE sql IMMUTABLE STRICT ? An IMMUTABLE function can't modify the database http://www.postgresql.org/docs/current/static/xfunc-volatility.html STRICT: http://www.postgresql.org/docs/8.2/static/xfunc-c.html ,----[ ] | Notice that we have specified the functions as "strict", meaning that | the system should automatically assume a null result if any input value | is null. `---- Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net