AC solution using groupby & order


  • 0
         select name from 
         (select CandidateId from Vote
          group by CandidateId
          order by count(*) desc limit 0,1) as c,
          Candidate
          where c.CandidateId = Candidate.id

Log in to reply
 

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