I'm trying to use MIN function in SQL, but I keep getting a lot of rows, and not just the MIN row.
I'm using this tutorial http://www.w3schools.com/SQl/trysql.asp?filename=trysql_func_min
running this query
SELECT
P.ProductID,
MIN(Price) AS SmallestOrderPrice
FROM Products P
GROUP BY ProductID;
I want to get just the row that has the min price from all prices, and it's corresponding product. If more than one product has the same price, I would like it to return both products.