person(id, dogs)
how would I find the person with the most dogs
select *
from person p1
where p1.id in (
select p2.id
from person p2
where p1.id = p2.id
having count(dogs > (
select p3.id ...etc
am I on the right track or will this not work? thanks for taking a look