On Wed, 11 Dec 2019, Ron wrote:
The SUM() function?
Ron,
Interesting. I'll look at this, too.
Regards,
Rich
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;
Michae
On Wed, Dec 11, 2019 at 1:54 PM Rich Shepard
wrote:
> A sampling location table has 28 distinct sites, each site being sampled
> from 1 to 67 times. I'm trying to obtain the number of sites having 1
> sample, 2 samples, ... 67 samples and am not seeing the solution despite
> several alternative q