Symmetric Pairs

  • + 0 comments

    SELECT A.X,A.Y FROM Functions A JOIN Functions B ON (A.X = B.Y AND A.Y = B.X) OR (A.X = B.X AND A.Y = B.Y) WHERE A.X <= A.Y GROUP BY A.X,A.Y HAVING COUNT(*) > 1 ORDER BY A.X,A.Y;