Re: Ambiguous error message

From: Samuel Tardieu <sam(at)rfc1149(dot)net>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Ambiguous error message
Date: 2004-01-03 00:56:19
Message-ID: 2004-01-03-01-56-19+trackit+sam@rfc1149.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2004-01-03 01:05:19 Re: Ambiguous error message
Previous Message Samuel Tardieu 2004-01-03 00:55:12 Re: Ambiguous error message