pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Samuel Tardieu <sam@rfc1149.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Ambiguous error message
Date: Fri, 2 Jan 2004 18:05:19 -0700
Message-ID: <20040102180519.A12370@quality.qadas.com> (raw)
In-Reply-To: <87smiy1ej9.fsf@inf.enst.fr>
References: <87smiy1ej9.fsf@inf.enst.fr>

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/



view thread (7+ messages)  latest in thread

Message-ID: <20040102180519.A12370@quality.qadas.com>
Permalink:  ../20040102180519.A12370@quality.qadas.com/
Also on:    postgresql.org/message-id/20040102180519.A12370@quality.qadas.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, sam@rfc1149.net
  Subject: Re: Ambiguous error message
  In-Reply-To: <20040102180519.A12370@quality.qadas.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox