Re: Ambiguous error message - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: Ambiguous error message
Date
Msg-id 20040102180519.A12370@quality.qadas.com
Whole thread Raw
In response to Ambiguous error message  (Samuel Tardieu <sam@rfc1149.net>)
List pgsql-sql
On Fri, Jan 02, 2004 at 05:49:46PM +0100, Samuel Tardieu wrote:
> 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?

The query has a right parenthesis after "as total" that looks like
it shouldn't be there.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-sql by date:

Previous
From: Samuel Tardieu
Date:
Subject: Re: Ambiguous error message
Next
From: "Andy Lewis"
Date:
Subject: sort by on two columns