आप इसे row_number()
. के साथ कर सकते हैं :
select region, month, MemberId, sales
from (select region, month, MemberId, sum(sales) as sales
row_number() over (partition by region, month order by sum(sales) desc) as seqnum
from table t
group by region, month, MemberId
) t
where seqnum <= 2;