Created
April 17, 2022 16:31
-
-
Save rchardptrsn/55d3583a8d0e7ae93e3d088201b4ceb8 to your computer and use it in GitHub Desktop.
county totals with geom.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT f.county, f.well_count, co.geom -- pgAdmin will recognize co.geom | |
FROM ( -- subquery to get totals by county | |
SELECT county, COUNT(county) well_count | |
FROM fracking | |
GROUP BY county | |
) f | |
LEFT JOIN co_counties co -- all from f, matching from co | |
ON f.county = co.county |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment