Symmetric Pairs

  • + 0 comments

    select concat(f1.x," ",f1.y) from functions f1 join functions f2 on concat(f1.x," ",f1.y)=concat(f2.y," ",f2.x) group by f1.x,f1.y having case when f1.x=f1.y and count(concat(f1.x," ",f1.y))>1 then 1 when f1.x!=f1.y then 1 else 2 end = 1 and f1.x<=f1.y order by f1.x asc