I would like to count the number of smaller polygons (lakes) within three specific polygons (counties). I have been able to get the to data sets to show up in the queried table but can not get the SUM of the lakes. I believe you are suppose to use the SUM but do not know where to place it without getting an error.
SELECT c.county, a.name
FROM public.counties AS c INNER JOIN
public.lakes AS a ON ST_Intersects(c.geom, a.geom)
WHERE c.county = 'JEFFERSON'
OR c.county = 'DENVER'
OR c.county = 'ADAMS'
GROUP BY c.county, a.name;