LeetCode1 LeetCode 602. Friend Requests II: Who Has the Most Friends 602. Friend Requests II: Who Has the Most FriendsSELECT *FROM (SELECT id, SUM(num) AS num FROM (SELECT requester_id AS id, COUNT(requester_id) AS numFROM RequestAcceptedGROUP BY requester_id UNION ALLSELECT accepter_id AS id, COUNT(accepter_id) AS numFROM RequestAcceptedGROUP BY accepter_id) AS TOTGROUP BY idORDER BY 2 DESC) AS STOTLIMIT 1 조인인줄 알았는데 from 보다 select로 먼저 생각해보니 friends 수를 세려면 reques.. 2024. 5. 24. 이전 1 다음