I want to basically take one spatial table of polygons and determine if any of the polygons interest with another table of polygons and save the results in a new table with a new column saving the result as true or false. The script below works:
CREATE TABLE test_table AS SELECT parcels.*, COALESCE(ST_Intersects(parcels.wkb_geometry, flood.wkb_geometry), false) AS intersects FROM parcels LEFT OUTER JOIN flood ON ST_Intersects(parcels.wkb_geometry, flood.wkb_geometry);
However I do get duplicates when a polygon from the first table is intersected by multiple polygons from the second table. As seen below:
I would like to only have one entry per polygon, even if it has been intersected multiple times. I have been removing duplicate rows as a work around, but I wanted to know if there is a more elegant way of doing this.