Ambiguous error message

From: Samuel Tardieu <sam(at)rfc1149(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Ambiguous error message
Date: 2004-01-02 16:49:46
Message-ID: 87smiy1ej9.fsf@inf.enst.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)rfc1149(dot)net -- http://www.rfc1149.net/sam

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2004-01-03 00:46:17 Re: Ambiguous error message
Previous Message Tom Lane 2004-01-02 02:10:21 Re: Stored procedures