题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
WITH t AS(SELECT departure_airport id, flights_count cnt FROM Flights UNION ALL SELECT arrival_airport, flights_count FROM Flights), tt AS(SELECT id, RANK() OVER(ORDER BY SUM(cnt) DESC) rk FROM t GROUP BY 1) SELECT id airport_id FROM tt WHERE rk = 1