Re: regd count(count(*)) in group by

From: Matthew Kirkwood <matthew(at)hairy(dot)beasts(dot)org>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: Yuva Chandolu <ychandolu(at)ebates(dot)com>, "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: regd count(count(*)) in group by
Date: 2002-07-26 22:09:08
Message-ID: Pine.LNX.4.33.0207262308170.24994-100000@sphinx.mythic-beasts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert E. Bruccoleri 2002-07-27 01:46:30 Question about LWLockAcquire's use of semaphores instead of spinlocks
Previous Message Rod Taylor 2002-07-26 20:50:31 Re: regd count(count(*)) in group by