Skip to content

Instantly share code, notes, and snippets.

@mdiener21
Last active September 11, 2019 15:07
Show Gist options
  • Save mdiener21/68c5b75835494f6fb78ab10f5ed16c64 to your computer and use it in GitHub Desktop.
Save mdiener21/68c5b75835494f6fb78ab10f5ed16c64 to your computer and use it in GitHub Desktop.
Select all polygons that contain 1 or more points
SELECT DISTINCT s.id, s.tags
FROM myspace_polys as s
JOIN mypoi_points as as p
ON ST_Contains(s.geom, p.geom);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment