Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: SQLServerCentral apologizes and you can win a book

    -- Ranking of orders by OrderTotal per Account/Year

    SELECT

    A1.Account

    ,Year(SO1.OrderDate) OrderYear

    ,Rank() OVER(Partition by A1.Account,Year(SO1.OrderDate) Order By SO1.OrderTotal Desc) AS Rank_Num

    ,SO1.OrderTotal OrderTotal

    FROM SalesOrder...

Viewing post 1 (of 1 total)