Correct data:
SELECT ID1, ID2 FROM likes WHERE ID1 < ID2 UNION SELECT ID2 AS ID1, ID1 AS ID2 FROM likes WHERE ID1 > ID2;
... then fix the leak by adding data integrity constraints to the table, for example.
CREATE TABLE likes ( ID1 INTEGER NOT NULL, ID2 INTEGER NOT NULL, CHECK (ID1 < ID2), UNIQUE (ID1, ID2) );
source share