Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7OKhOf00982 for ; Fri, 24 Aug 2001 16:43:24 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 108012; Fri, 24 Aug 2001 13:43:21 -0700 From: "Josh Berkus" Subject: Re: WHERE on an alias To: Joseph Shraibman Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Fri, 24 Aug 2001 13:43:21 -0700 Message-ID: In-Reply-To: <3B86B6AA.3020309@selectacast.net> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200108/305 X-Sequence-Number: 4551 Joseph, > playpen=# SELECT a, sum(b) as dsum > playpen-# FROM taba > playpen-# GROUP BY a > playpen-# HAVING dsum > 5; Sorry, my mistake: SELECT a, sum(b) as dsum FROM taba GROUP BY a HAVING sum(b) > 5; I had the impression that aliases for aggregates were allowed in Postgres HAVING clauses. Apparently not. -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco