18.当选者
链接:https://leetcode-cn.com/problems/winning-candidate/
select Name from
(
--建立临时表,用来查找选票最多人的id号码
select c.id,count(v.CandidateId) as time
from Candidate c left join Vote v
on c.id=v.CandidateId
group by v.CandidateId
--通过limit进行筛选得到id
order by time desc limit 0,1
)as T
join Candidate
--在Candidate中找到筛选得到的id
on T.id= Candidate.id