X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 84A7CD1DF1E for ; Sat, 3 Jan 2004 01:51:24 +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 85811-09 for ; Fri, 2 Jan 2004 21:50:43 -0400 (AST) Received: from mail.rfc1149.net (marvin.enst.fr [137.194.161.2]) by svr1.postgresql.org (Postfix) with ESMTP id A9083D1E0D5 for ; Fri, 2 Jan 2004 20:55:29 -0400 (AST) Received: from beeblebrox.rfc1149.net (beeblebrox-tun.enst.fr [137.194.161.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "beeblebrox.rfc1149.net", Issuer "Top-level signer" (verified OK)) by mail.rfc1149.net (Postfix) with ESMTP id 4F4A4A8093; Sat, 3 Jan 2004 01:55:13 +0100 (CET) Received: by beeblebrox.rfc1149.net (Postfix, from userid 1000) id 81D78AA7; Sat, 3 Jan 2004 01:55:12 +0100 (CET) Date: Sat, 3 Jan 2004 01:55:12 +0100 To: Michael Glaesemann Cc: pgsql-sql@postgresql.org Subject: Re: Ambiguous error message References: <87smiy1ej9.fsf@inf.enst.fr> <3DB0CA70-3D86-11D8-A298-000A95C88220@myrealbox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DB0CA70-3D86-11D8-A298-000A95C88220@myrealbox.com> User-Agent: Mutt/1.5.5.1i From: Samuel Tardieu Organization: RFC 1149 (see http://www.rfc1149.net/) Content-Transfer-Encoding: 8bit Precedence: special-delivery X-WWW: http://www.rfc1149.net/sam X-Mail-Processing: Sam's procmail tools X-Jabber: (see http://www.jabber.org/) X-OpenPGP-Fingerprint: 79C0 AE3C CEA8 F17B 0EF1 45A5 F133 2241 1B80 ADE6 (see http://www.gnupg.org/) X-Sam-Laptop: yes Message-Id: <2004-01-03-01-55-12+trackit+sam@rfc1149.net> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/6 X-Sequence-Number: 16399 On 2/01, Michael Glaesemann wrote: | I'm not quite sure what you want the query to return, but you've got a | problem with your parentheses. I can't believe this :) I got hit by the "inner query needs to be aliased" message and added it to the wrong place and them munged the query a lot. The correct one was of course: # select texten, total from (select protocolid, count(*) as total from ips where catid=1 group by protocolid order by protocolid) as c inner join protocols using (protocolid); (PostgreSQL is used for the will-spam-for-food black-list, see http://www.rfc1149.net/wsff) Sam