Skip site navigation (1) Skip section navigation (2)

Re: Possible parsing problem?

From: Andrew Gould <andrewgould(at)yahoo(dot)com>
To: nolan(at)celery(dot)tssi(dot)com,pgsql general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Possible parsing problem?
Date: 2003-06-30 16:29:32
Message-ID: 20030630162932.57918.qmail@web13403.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-general
Try giving the "count" items names.  I just ran the
following with good results:

select fy, yrmo, count(pt_id) as cases,
count(er_level) as er_cases from case_fy2003 group by
fy, yrmo order by cases desc;

Does this address your issue?

Andrew Gould

--- nolan(at)celery(dot)tssi(dot)com wrote:
> The following does NOT produce an error on the
> 'order by' clause, 
> though perhaps it should?   
> 
>     SELECT col, count(*) from table group by col
> order by count;
> 
> If there is more than one count() function in the
> query, it does crete
> am error for the ambiguous reference.
> 
> (FWIW, Oracle and MySQL both generate an error.)
> --
> Mike Nolan
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>               
http://www.postgresql.org/docs/faqs/FAQ.html


In response to

pgsql-general by date

Next:From: Tom LaneDate: 2003-06-30 16:57:38
Subject: Re: Possible parsing problem?
Previous:From: Jonathan GardnerDate: 2003-06-30 16:20:13
Subject: Re: sql standard questions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group