Symmetric Pairs

  • + 0 comments

    SELECT DISTINCT f1.x AS x1, f1.y AS y1 FROM functions f1 JOIN functions f2 ON f1.x = f2.y AND f1.y = f2.x WHERE f1.x <= f1.y group by f1.x,f1.y having (count(x1)>1 and f1.x=f1.y) or (f1.x<>f1.y) ORDER BY f1.x

    i tried this