574. Winning Candidate

select a.name from candidate a

inner join

(

select candidateid, count(*) no_of_votes

from vote

group by candidateid

order by no_of_votes desc

limit 1) b

on a.id = b.candidateid;

posted @ 2018-10-22 09:55  ffeng0312  阅读(164)  评论(0)    收藏  举报