SELECT t.id, COUNT(t.id) AS num FROM (SELECT requester_id AS id FROM request_accepted UNION ALL SELECT accepter_id AS id FROM request_accepted) AS t GROUP BY t.id ORDER BY num DESC LIMIT 1;
leetcode-602 Friend Requests 2: Who Has the Most Friends
Remember:SELECT t.id, COUNT(t.id) AS num FROM(SELECT requester_id AS id FROM request_acceptedUNION ALLSELECT accepter_id AS id FROM request_accepted) AS tGROUP BY t.idORDER BY num DESC LIMIT 1;...