728x90
www.hackerrank.com/challenges/symmetric-pairs/problem
JOIN을 이용한 간단한 문제입니다.
문제의 조건은 X1 = Y2 && X2 = Y1 이여야 합니다.
select f1.x, f1.y
from functions f1 join functions f2
on (f1.x = f2.y and f2.x = f1.y)
group by f1.x, f1.y
having count(*) > 1 or f1.x < f1.y
order by f1.x
728x90
'Algorithms 🚀 > HackerRank' 카테고리의 다른 글
[해커랭크/SQL] Top Competitors (0) | 2021.05.09 |
---|---|
[해커랭크/SQL] New Companies (0) | 2021.05.09 |
[MySQL/해커랭크] Weather Observation Station 20 (0) | 2021.05.05 |
[MySQL/해커랭크] The Report (0) | 2021.05.03 |
[MySQL/해커링크] Placements (0) | 2021.04.25 |