SELECT SupplierCompany, ProductTypeName, ProductName, BuyingPrice, SoldPrice, SUM(Amount) as AmountSum, SUM(SoldPrice - BuyingPrice) as DifferencePrice FROM Products, Suppliers, ProductTypes WHERE ProductName LIKE "По*" AND Suppliers.ID = Products.SupplierID AND Products.ProductTypeID = ProductTypes.ID GROUP BY Products.ID, SupplierID, SupplierCompany, ProductTypeID, ProductTypeName, ProductName, BuyingPrice, SoldPrice ORDER BY SupplierCompany, ProductTypeName, ProductName
|