Symmetric Pairs

  • + 0 comments

    select distinct a.x, a.y from Functions a inner join functions b on a.x=b.y and b.x=a.y where a.x<=a.y

    -- to remove self join cases if equal pair (A,A) exist in the table, it will self join so i'll check the result in the base table that (A,A) cases should have atleast 1 entry

    and (a.x != a.y or ( select count(*) from functions where x=a.x and y=a.y )>1) order by a.x