You are viewing a single comment's thread. Return to all 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
Seems like cookies are disabled on this browser, please enable them to open this website
Symmetric Pairs
You are viewing a single comment's thread. Return to all 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