You could use exists logic here:
SELECT id, column1, column2
FROM yourTable t1
WHERE NOT EXISTS (SELECT 1 FROM yourTable t2
WHERE LEAST(t2.column1, t2.column2) = LEAST(t1.column1, t1.column2) AND
GREATEST(t2.column1, t2.column2) = GREATEST(t1.column1, t1.column2));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…