Набор данных:
Код: Выделить всё
Bill_Id Month Product_Id Net_Value
1 1 20 100
2 1 20 100
3 2 20 100
4 1 30 200
5 2 30 200
6 2 30 200
Код: Выделить всё
Product_Id Total_revenue Top_Month
20 300 1
30 600 2
Подробнее здесь: https://stackoverflow.com/questions/711 ... -month-pan