the outputhow can i output number orders for each year and Month
I have tried the code but it gives me two columns instead of 4, by each year and month
select month (orderdate), year (orderdate) ,
count (orderdate) over (partition by year(orderdate) Order By year(orderdate) desc) as countoforders
from sales.SalesOrderHeader
group by year (orderdate), month (orderdate),orderdate