Symmetric Pairs

Sort by

recency

|

1569 Discussions

|

  • + 0 comments

    SELECT DISTINCT X1,Y1 FROM (Select F1.X X1,F1.Y Y1,F2.X X2,F2.Y Y2 from Functions F1 , Functions F2) WHERE X1=Y2 AND X2=Y1 AND X1<=Y1 ORDER BY 1 ;

  • + 0 comments

    select * from ((select distinct f1.X, f1.Y from functions f1 join functions f2 on f1.X = f2.Y and f1.Y = f2.X and f1.X < f1.Y ) union (select X, Y from functions where X=Y group by X,Y having count(*) > 1))t order by t.X

  • + 0 comments
    select distinct f.X, f.y from Functions f join functions f1 on f.x = f1.y and f.y =f1.x where f.x <= f1.y 
    group by f.x,f.y
    HAVING COUNT(*) > 1 OR f.X < f.Y
    ORDER BY f.X;
    
  • + 0 comments

    select X,Y from ( select X,Y,LEAD(Y) over() as Y2, LEAD(X) over() as X2,abs(X-Y) as diff from Functions order by diff,X ) as sub where X=Y2 and Y=X2 order by X

  • + 0 comments

    SELECT f.X, f.Y FROM Functions AS f inner join Functions AS f1 on f.X=f1.Y AND f.Y=f1.X WHERE f.X <= f.Y GROUP by f.X,f.Y HAVING f.X < f.Y or (count(f1.x)>=2) ORDER BY f.X