We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Advanced Join
- Symmetric Pairs
- Discussions
Symmetric Pairs
Symmetric Pairs
Sort by
recency
|
1501 Discussions
|
Please Login in order to post a comment
Select sth.X,sth.Y from ( select f1.X as X, f1.Y AS Y --, f2.X as X2,f2.Y as Y2 from functions f1 CROSS JOIN functions f2 where f1.X< f1.Y and f1.X = f2.Y and f2.X = f1.Y
UNION
SELECT X, Y from functions where X = Y group by X,Y having count(*) > 1) sth Order by sth.X,sth.Y
thank you