How to get topn of max by druid?

Hello All,
I would like to get topn(max(aggregation5min(metric))), How can I do?