You are viewing a single comment's thread. Return to all comments →
Update: Forgot to order the output. It works once I added "order by a.x"...
WITH CTE AS ( select *, row_number() over(order by X asc) as rowN from Functions)
select distinct a.X, a.Y from CTE a inner join CTE b on a.X = b.Y and a.Y = b.X where a.rowN != b.rowN and a.X <= a.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 →
Update: Forgot to order the output. It works once I added "order by a.x"...
WITH CTE AS ( select *, row_number() over(order by X asc) as rowN from Functions)
select distinct a.X, a.Y from CTE a inner join CTE b on a.X = b.Y and a.Y = b.X where a.rowN != b.rowN and a.X <= a.Y;