update bookmark blog 03/15/2015 (a.m.)

Posted from Diigo. The rest of my favorite links are here.

Advertisements

update bookmark blog 03/04/2015 (a.m.)

    • SELECT
           soh.SalesOrderID
           ,soh.OrderDate
           ,sod.max_unit_price
           ,sod.sum_line_total
       FROM AdventureWorks.Sales.SalesOrderHeader AS soh
       CROSS APPLY
       (
           SELECT
               max_unit_price = MAX(sod.UnitPrice)
               ,sum_line_total = SUM(sod.LineTotal)
           FROM Sales.SalesOrderDetail AS sod
           WHERE soh.SalesOrderID = sod.SalesOrderID
       ) sod

Posted from Diigo. The rest of my favorite links are here.