Skip to main content
2 of 5
testing the id will be faster than testing the whole row
Paul Ramsey
  • 20k
  • 2
  • 49
  • 58

Try something like this

SELECT DISTINCT ON (boundary.d) boundary.*
FROM boundary, location
WHERE ST_Intersects (boundary.geom, location.geom)
Martin F
  • 9k
  • 38
  • 60