X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A9D039DC973 for ; Thu, 16 Feb 2006 18:41:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35506-05 for ; Thu, 16 Feb 2006 18:41:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by postgresql.org (Postfix) with ESMTP id 485299DC857 for ; Thu, 16 Feb 2006 18:41:27 -0400 (AST) Received: from [84.157.0.176] (helo=lunix.schabi.de) by mrelayeu.kundenserver.de (node=mrelayeu9) with ESMTP (Nemesis), id 0ML2xA-1F9roX2x4K-0000i4; Thu, 16 Feb 2006 23:41:30 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lunix.schabi.de (Postfix) with ESMTP id 478A11CD466; Thu, 16 Feb 2006 23:41:28 +0100 (CET) Message-ID: <43F4FF98.9090704@logix-tt.com> Date: Thu, 16 Feb 2006 23:41:28 +0100 From: Markus Schaber User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Mark Fenbers CC: PostgreSQL - SQL Subject: Re: group by complications References: <20060214022937.77875.qmail@web54305.mail.yahoo.com> <43F4BACB.60600@noaa.gov> In-Reply-To: <43F4BACB.60600@noaa.gov> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:a9554655f07a4e401310f2acfb43f5bf X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.127 required=5 tests=[AWL=0.127] X-Spam-Score: 0.127 X-Spam-Level: X-Archive-Number: 200602/216 X-Sequence-Number: 24226 Hi, Mark, Mark Fenbers schrieb: > Wow! I didn't know you could have a (select ...) as a replacement for a > 'from' table/query. Your SQL worked as-is, except I had to add a 'limit > 1' to the first subquery. > > Thanks! I would have never figured that out on my own! SQL has more power than most think, and PostgreSQL does a good job in implementing most of it. Much more than some other well known "free" databases. Have a look at http://www.postgresql.org/docs/8.1/static/sql-select.html and the other SQL commands at http://www.postgresql.org/docs/8.1/static/sql-commands.html (or your local copy of the manual). HTH, Markus