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

From Matthew Kirkwood
Subject Re: regd count(count(*)) in group by
Date
Msg-id Pine.LNX.4.33.0207262308170.24994-100000@sphinx.mythic-beasts.com
Whole thread Raw
In response to Re: regd count(count(*)) in group by  (Rod Taylor <rbt@zort.ca>)
List pgsql-hackers
On 26 Jul 2002, Rod Taylor wrote:

> Try this:
>
> SELECT count(*)
>   FROM (
>     SELECT count(*)
>     FROM test
>     GROUP BY date_trunc('day', test_date)
>     ) as qry;

Or this:
SELECT COUNT(*)FROM (    SELECT DISTINCT(date_trunc('day', test_date))    FROM test);

Matthew.



pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: regd count(count(*)) in group by
Next
From: "Robert E. Bruccoleri"
Date:
Subject: Question about LWLockAcquire's use of semaphores instead of spinlocks