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.
select * from (select * from functions where (y, x) in (select * from functions) and x < y union select * from functions where x = y group by x, y having count(*) = 2) t order by x, y
Cookie support is required to access HackerRank
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 →
select * from (select * from functions where (y, x) in (select * from functions) and x < y union select * from functions where x = y group by x, y having count(*) = 2) t order by x, y