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 8867ED1E190 for ; Sat, 3 Jan 2004 00:17:59 +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 72761-07 for ; Fri, 2 Jan 2004 20:17:16 -0400 (AST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id BCF6ED1E1B3 for ; Fri, 2 Jan 2004 19:53:05 -0400 (AST) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AcSV2-0002Br-00 for ; Fri, 02 Jan 2004 17:50:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AcSUz-0002Bi-00 for ; Fri, 02 Jan 2004 17:50:09 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AcSUz-0005zw-00 for ; Fri, 02 Jan 2004 17:50:09 +0100 From: Samuel Tardieu Subject: Ambiguous error message Date: Fri, 02 Jan 2004 17:49:46 +0100 Organization: Avian Carrier & Friends Lines: 17 Message-ID: <87smiy1ej9.fsf@inf.enst.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.5 (celery, berkeley-unix) Cancel-Lock: sha1:8CEkgea7kBnf6TUJ5iI833zU2b8= X-Leafnode-NNTP-Posting-Host: 127.0.0.1 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/3 X-Sequence-Number: 16396 In PostgreSQL 7.4, the following select: 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); gives the error message: ERROR: subquery in FROM must have an alias HINT: For example, FROM (SELECT ...) [AS] foo. Why isn't the "as c" considered as an alias? Sam -- Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam