# 문제
https://leetcode.com/problems/friend-requests-ii-who-has-the-most-friends/description/
# 문제 요약

가장 친구가 많은 사람의 번호와 그 숫자를 세기
# 문제 핵심
테이블을 합치는 방식
1. 조인
2. union
이번 문제에서는 union all을 사용하여 합쳤다
# 정답 코드
with cte as (
select requester_id as id
from RequestAccepted
union all
select accepter_id as id
from RequestAccepted
), cte2 as (
select id,
count(*) as num
from cte
group by id
)
select id, num
from cte2
where num = (
select max(num)
from cte2
)