All pastes #904393 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-14 22:20 UTC
rendered paste body
SELECT     Category.Description AS Category, InvoiceDetail.ProductID AS ProductId, Product.Description AS ProductName, Sum(InvoiceDetail.Quantity) 
                      AS Quantity, InvoiceDetail.Price AS Revenue
FROM         InvoiceDetail INNER JOIN
                      Product ON Product.ProductID = InvoiceDetail.ProductID INNER JOIN
                      Category ON Category.CategoryID = Product.CategoryId
GROUP BY InvoiceDetail.ProductID, Product.Description, Category.Description, InvoiceDetail.Price
order by  Product.Description