I'm trying to find duplicates in a non-traditional scenario:

Sample Table:

```
id1  | id2
-----+-----
ABC  | DEF
DEF  | ABC

```

I only want to retain one of these rows, as these ids show a connection to each other. What is the most elegant way to filter out the second row?