LeetCode刷题实战574:当选者
示例
解题
# Write your MySQL query statement below
select Name
from Candidate c left join
(
select CandidateId, count(*) num
from Vote
group by CandidateId
) v
on c.id = v.CandidateId
order by v.num desc
limit 1
评论
# Write your MySQL query statement below
select Name
from Candidate c left join
(
select CandidateId, count(*) num
from Vote
group by CandidateId
) v
on c.id = v.CandidateId
order by v.num desc
limit 1