select *
from (
select age, hobbies, count(*) cnt
from user_hobbies
group by age, hobbies
) age_hobbies
join (
select age, max(cnt) maxcnt
from (
select age, hobbies, count(*) cnt
from user_hobbies
group by age, hobbies
) h group by age
) max_age_hobbies on
age_hobbies.age = max_age_hobbies.age and
age_hobbies.cnt = max_age_hobbies.maxcnt;