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

Rich Shepard <[email protected]>
Newsgroups gmane.comp.db.postgresql.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.