Skip to content

Instantly share code, notes, and snippets.

@bitner
Created February 6, 2015 22:30
Show Gist options
  • Save bitner/1f3d1c755eff4d70b485 to your computer and use it in GitHub Desktop.
Save bitner/1f3d1c755eff4d70b485 to your computer and use it in GitHub Desktop.
WITH t AS (
SELECT id, (SELECT min(val), max(val) FROM mytable WHERE st_dwithin(geom,a.geom,16093)) b,geom FROM mytable a
)
SELECT id, (b).min, (b).max, geom FROM t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment