I assume one record is stored for each vote?
SELECT COUNT(idColumn) as numVotes, petName FROM votes GROUP BY petName
GROUP BY petName will return one row for each petName. numVotes will contain the number of votes for each petName. you could add ORDER BY COUNT(idColumn) DESC so that the number of votes is orderred highest to to lowest.