5트만에 성공한 문제...
구조를 짜고 논리를 맞게 만드려면 깊생이 필요하다.

You are given a table, Functions, containing two columns: X and Y.

Two pairs (X1, Y1) and (X2, Y2) are said to be symmetric pairs if X1 = Y2 and X2 = Y1.
Write a query to output all such symmetric pairs in ascending order by the value of X. List the rows such that X1 ≤ Y1.
Sample Input

WITH TEMP AS
(
SELECT X, Y
FROM FUNCTIONS
GROUP BY X, Y
HAVING COUNT(*) > 1 OR X != Y
)
SELECT T1.X, T1.Y
FROM TEMP AS T1
INNER JOIN TEMP AS T2
ON T1.X = T2.Y AND T1.Y = T2.X
WHERE T1.X < T1.Y OR T1.X = T1.Y
ORDER BY T1.X;