Re: Counting number of sites with same number of sampling dates - Mailing list pgsql-general

From Rich Shepard
Subject Re: Counting number of sites with same number of sampling dates
Date
Msg-id alpine.LNX.2.20.1912111308280.10822@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Counting number of sites with same number of sampling dates  (Michael Lewis <mlewis@entrata.com>)
List 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



pgsql-general by date:

Previous
From: Michael Lewis
Date:
Subject: Re: Counting number of sites with same number of sampling dates
Next
From: Rich Shepard
Date:
Subject: Re: Counting number of sites with same number of sampling dates