pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bertrand Petit <pgsql-sql@phoe.frmug.org>
To: pgsql-sql@postgresql.org
Subject: Re: Ambiguous error message
Date: Sat, 3 Jan 2004 02:30:34 +0100
Message-ID: <20040103023034.A5150@memo.frmug.org> (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:
> 
> select texten, total
> from (select protocolid, count(*) as total) from ips where catid=1
                                            ^
                                            +--- There
>       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?

	That's maybe due to the highlighted spurious parenthesis.

-- 
%!PS
297.6 420.9 translate 90 rotate 0 setgray gsave 0 1 1{pop 0 180 moveto 100
180 170 100 170 -10 curveto 180 -9 180 -9 190 -10 curveto 190 100 100 180
0 180 curveto fill 180 rotate}for grestore/Bookman-LightItalic findfont
240 scalefont setfont -151.536392 -63.7998886 moveto (bp)show showpage



view thread (7+ messages)

Message-ID: <20040103023034.A5150@memo.frmug.org>
Permalink:  ../20040103023034.A5150@memo.frmug.org/
Also on:    postgresql.org/message-id/20040103023034.A5150@memo.frmug.org

 · 

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: pgsql-sql@phoe.frmug.org
  Subject: Re: Ambiguous error message
  In-Reply-To: <20040103023034.A5150@memo.frmug.org>

* 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