Symmetric Pairs

  • + 0 comments

    Good old nested queries: select f.x, f.y from (select f.x, f.y, min(f.rowid) r from functions f where f.x <= f.y group by f.x, f.y) f where exists (select 1 from functions f1 where f1.x = f.y and f1.y = f.x and f1.rowid <> f.r) order by f.x;