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 s1.id,s2.id from scale_polygons_v4 s1 inner join scale_polygons_v4 s2 on s1.id!=s2.id and s1.kind=s2.kind and st_overlaps(s1.geom,s2.geom)
The results are correct, but with duplicate comparisons it returns for example:
There are multiple such cases I only want to get one comparison.