Re: Counting number of sites with same number of sampling dates

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Counting number of sites with same number of sampling dates
Date: 2019-12-11 21:09:48
Message-ID: alpine.LNX.2.20.1912111308280.10822@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 11 Dec 2019, Michael Lewis wrote:

> Put what you have in a subquery and group/aggregate again.
>
> select sample_count, count( site_nbr ) FROM (
> select site_nbr, count(distinct sampdate) AS sample_count from wrb_hg_cong
> group by site_nbr order by site_nbr
> ) sub
> group by sample_count;

Michael,

Well, darn! I totally speced using a subquery. Thank you very much for an
important lesson.

Best regards,

Rich

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-12-11 21:11:05 Re: Counting number of sites with same number of sampling dates
Previous Message Michael Lewis 2019-12-11 20:58:35 Re: Counting number of sites with same number of sampling dates