Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: SQLServerCentral apologizes and you can win a book

    Here is one that use partitions:

    USE AdventureWorks2012;

    GO

    SELECT SalesOrderID, ProductID, OrderQty

    ,SUM(OrderQty) OVER(PARTITION BY SalesOrderID) AS Total

    ,CAST(1. * OrderQty / SUM(OrderQty) OVER(PARTITION BY SalesOrderID)...

Viewing post 1 (of 1 total)