select * from
(
select animal,age,id,
row_number()over(partition by animal order by age desc) row_num
from zoo
)
where row_num <=5;
2023-08-06 11:22:04
select * from
(
select animal,age,id,
row_number()over(partition by animal order by age desc) row_num
from zoo
)
where row_num <=5;