I have a table like this:
Column | Type | Modifiers ---------+------+----------- country | text | food_id | int | eaten | date |
select country,food_id, count(*) ne from food f1 group by country,food_id having count(*) = (select max(count(*)) from food f2 where country = f1.country group by food_id)