1SELECT { fn MONTHNAME(OrderDate) } AS MonthName, YEAR(OrderDate) AS Year, SUM(TotalValue) AS Profits
2FROM [Order]
3WHERE (YEAR(OrderDate) = @year)
4GROUP BY { fn MONTHNAME(OrderDate) }, MONTH(OrderDate), YEAR(OrderDate)
5order by Year(orderDate),month(OrderDate)
6