pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Samuel Tardieu <sam@rfc1149.net>
To: Michael Glaesemann <grzm@myrealbox.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Ambiguous error message
Date: Sat, 3 Jan 2004 01:56:19 +0100
Message-ID: <2004-01-03-01-56-19+trackit+sam@rfc1149.net> (raw)
In-Reply-To: <2004-01-03-01-55-12+trackit+sam@rfc1149.net>
References: <87smiy1ej9.fsf@inf.enst.fr>
	<3DB0CA70-3D86-11D8-A298-000A95C88220@myrealbox.com>
	<2004-01-03-01-55-12+trackit+sam@rfc1149.net>

On  3/01, Samuel Tardieu wrote:

| On  2/01, Michael Glaesemann wrote:
| 
| | I'm not quite sure what you want the query to return, but you've got a 
| | problem with your parentheses.
| 
| I can't believe this :) I got hit by the "inner query needs to be aliased"
| message and added it to the wrong place and them munged the query a lot.
| 
| The correct one was of course:
| # 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);

(with the "order by" part moved at the end of the query to avoid losing the
order during the inner join)

  Sam




view thread (7+ messages)  latest in thread

Message-ID: <2004-01-03-01-56-19+trackit+sam@rfc1149.net>
Permalink:  ../2004-01-03-01-56-19+trackit+sam@rfc1149.net/
Also on:    postgresql.org/message-id/2004-01-03-01-56-19+trackit+sam@rfc1149.net

 · 

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: sam@rfc1149.net, grzm@myrealbox.com
  Subject: Re: Ambiguous error message
  In-Reply-To: <2004-01-03-01-56-19+trackit+sam@rfc1149.net>

* 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