Basically, for any DBMS you need to GROUP BY
the items that you are not performing aggregate functions on:
SELECT Products.ProductName AS ProductName
,Products.ProductNumber AS ProductNumber
,AVG(Products.WholesalePrice) AS AvgWholesalePrice
,AVG(Products.RetailPrice) AS AvgRetailPrice
FROM Products Products
INNER JOIN ProductVendors Vendors ON Products.ProductNumber = Vendors.DaysToDeliver
GROUP BY Products.ProductName, Products.ProductNumber;
Also, when doing JOIN
s you should really alias the tables appropriately and then reference the aliases with their fields. It is more transparent, requires less implicit translation by the SQL optimizer, and allows for better maintenance.