X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 317DED1B911 for ; Fri, 13 Feb 2004 14:08:40 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 97983-01 for ; Fri, 13 Feb 2004 10:08:40 -0400 (AST) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id EC7FAD1B8CE for ; Fri, 13 Feb 2004 10:08:36 -0400 (AST) Received: from [134.22.71.135] (dyn-71-135.tor.dsl.tht.net [134.22.71.135]) by tht.net (Postfix) with ESMTP id 8A45F76C39; Fri, 13 Feb 2004 09:08:42 -0500 (EST) Subject: Re: column alias and group by/having/order From: Rod Taylor To: Tomasz Myrta Cc: Lista dyskusyjna pgsql-sql In-Reply-To: <402CD27E.7050001@klaster.net> References: <402CD27E.7050001@klaster.net> Content-Type: text/plain Message-Id: <1076681344.10896.19.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 13 Feb 2004 09:09:05 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/145 X-Sequence-Number: 16836 > select val1+val2 as val > from some_table > group by val having val>1; > ERROR: Attribute "val" not found > > Is it a bug or a feature? It's a mis-feature that group by accepts aliases of the select list. Having is proper.