Symmetric Pairs

  • + 0 comments

    WITH CTE1 AS( SELECT X,Y,ROW_NUMBER() OVER(ORDER BY X ) As row_n FROM Functions )

    SELECT DISTINCT X,Y FROM( SELECT a.X,a.Y FROM CTE1 AS a INNER JOIN CTE1 AS b On a.X=b.Y AND a.Y=b.X AND a.row_n!=b.row_n) t1 WHERE X<=Y