mrwillcostello
SSC Eights!
Points: 925
More actions
March 28, 2012 at 7:49 pm
#259212
Select Orders.OrderID, 'Order Total', 'order count' from Orders,
(SELECT SUM ( [Order Details].UnitPrice*[Order Details].Quantity)
as [Order Total], Count(distinct(OrderID)) AS [Order Count]
from [Order Details] group by OrderID)
March 28, 2012 at 7:57 pm
#1466134
Never mind.Got it.
SELECT OrderID, SUM([Order Details].UnitPrice*[Order Details].Quantity)
AS 'Order Total', COUNT([Order Details].OrderID) AS 'Order Count'
FROM [Order Details]GROUP BY OrderID
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply