Remove duplicate comparisons in postgres?

by user3052682   Last Updated October 15, 2018 08:06 AM

I have a polygon layer named scale_polygons_v4 I want to get ids of overlapping polygons I have tried the code below

select distinct, from scale_polygons_v4 s1 
inner join scale_polygons_v4 s2
on! and s1.kind=s2.kind and st_overlaps(s1.geom,s2.geom)

results are fine but with duplicate comparisions e.g it returns


there are multiple such cases I only want to get one comparison

Tags : postgresql

Related Questions

Postgres gist slow index f_unaccent

Updated April 09, 2018 20:06 PM