Thursday 10 October 2013

18. Display the total unit price and the total amount collected after selling the products, 774 and 777. In addition, calculate the total amount collected from these two products. (Use the AdventureWorks database)

select productID,sum(UnitPrice) as TotalUnitPrice,sum (LineTotal) as TotalAmount from sales.salesOrderDetail
where productID in (777,774) group by cube(ProductID)

No comments:

Post a Comment