Re: regd count(count(*)) in group by - Mailing list pgsql-hackers

From Rod Taylor
Subject Re: regd count(count(*)) in group by
Date
Msg-id 1027716633.307.57.camel@jester
Whole thread Raw
In response to regd count(count(*)) in group by  (Yuva Chandolu <ychandolu@ebates.com>)
Responses Re: regd count(count(*)) in group by  (Matthew Kirkwood <matthew@hairy.beasts.org>)
List pgsql-hackers
Try this:

SELECT count(*) FROM (SELECT count(*)FROM testGROUP BY date_trunc('day', test_date)) as qry;


On Fri, 2002-07-26 at 16:03, Yuva Chandolu wrote:
> Hi,
> 
> We have a query "select count(count(*)) from test group by
> trunc(test_date)". This works fine with Oracle but when moving to postgres I
> changed it to "select count(count(*)) from test group by date_trunc('day',
> test_date)" but I get the following error
> 
> ERROR:  Aggregate function calls may not be nested
> 
> Can some one help me...
> 
> Thanks
> Yuva
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 




pgsql-hackers by date:

Previous
From: Yuva Chandolu
Date:
Subject: regd count(count(*)) in group by
Next
From: Matthew Kirkwood
Date:
Subject: Re: regd count(count(*)) in group by