문제
정답
SELECT name
FROM Candidate
JOIN (
SELECT candidateId, COUNT(candidateId) as votes
FROM Vote
GROUP BY candidateId
ORDER BY votes DESC
LIMIT 1 ) AS temp
ON Candidate.id = temp.candidateId
SELECT name
FROM Candidate
JOIN (
SELECT candidateId, COUNT(candidateId) as votes
FROM Vote
GROUP BY candidateId
ORDER BY votes DESC
LIMIT 1 ) AS temp
ON Candidate.id = temp.candidateId