?LeetCode刷題實戰(zhàn)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
評論
圖片
表情
