please tell me what is wrong with this query run on Northwind

  • 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)

  • 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