my solution using all which can handle tie issues


  • 0
    P

    SELECT id, count() as num FROM
    (select requester_id as id FROM request_accepted
    UNION ALL
    select accepter_id as id FROM request_accepted ) sub
    GROUP BY id
    having count(
    ) >= ALL (SELECT count(*) as num FROM
    (select requester_id as id FROM request_accepted
    UNION ALL
    select accepter_id as id FROM request_accepted ) sub
    GROUP BY id)


  • 0
    Z

    I believe you should add an asterisk in count(), then the code will work fine


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.