i have a PostgreSQL table describing lines between two points. It contains two columns, A and B, integers representing the id of a point (described in another table).
But each line is duplicated in the table, as the line going from A to B is the same that the line going from B to A.
I’d like to remove the duplicates, but i can’t find an aggregate function working on two columns, to regroup AB and BA lines then to remove one.
Thanks 🙂
Identifying the duplicates:
I think you should be able to delete one of the pairs using:
(Not tested!)