The query you have posted won't run; you would need to group by id, nameOfPet. This is personal preference, but I would also specify your join (to make it more readable and easier to change between types of join):
SELECT id, nameOfPet, COUNT(p.fed)
FROM petLover pl
LEFT OUTER JOIN pets p ON pl.nameOfPet = p.nameOfPet
WHERE id = 180
GROUP BY id, nameOfPet
ORDER BY COUNT(p.fed)
The LEFT OUTER JOIN will make sure you return all of the results from petLover, even if none have been fed (i.e. if none have been fed, you will return all petLovers). Change it back to an INNER JOIN if you only want results when an animal has been fed. Here's a modified query to do what you're looking for (based upon rows):
SELECT pl.id, pl.nameOfPet, COUNT(*)
FROM petLover pl
LEFT OUTER JOIN pets p ON pl.nameOfPet = p.nameOfPet
GROUP BY pl.id, pl.nameOfPet
HAVING COUNT(*) >= ALL (
SELECT COUNT(*)
FROM petLover pl
LEFT OUTER JOIN pets p ON pl.nameOfPet = p.nameOfPet
GROUP BY pl.id, pl.nameOfPet
)
ORDER BY COUNT(*) DESC
EDIT
Further to the answer to my question in the original comments, you should be able to do the following to modify the SQL above:
SELECT pl.id, pl.nameOfPet, SUM(p.fed)
FROM petLover pl
LEFT OUTER JOIN pets p ON pl.nameOfPet = p.nameOfPet
GROUP BY pl.id, pl.nameOfPet
HAVING SUM(p.fed) >= ALL (
SELECT SUM(p.fed)
FROM petLover pl
LEFT OUTER JOIN pets p ON pl.nameOfPet = p.nameOfPet
GROUP BY pl.id, pl.nameOfPet
)
ORDER BY SUM(p.fed) DESC