Symmetric Pairs

  • + 0 comments
    select distinct a.x, a.y
    from Functions a
    where a.x <= a.y
      and (select count(*) from Functions where x = a.y and y = a.x)
            >= case when a.x = a.y then 2 else 1 end
    order by a.x;