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/

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to