HI Folks, I have a problem in using the MIN function for MYSQL
I want to get the supplier of the lowest cost of a product inside a table based on product name
I currently have this data set...
Name | Cost | SupplierName
ProductA | 24.70 | SupplierA
ProductA | 22.00 | SupplierB
And my initial work produced the following query,
SELECT SupplierName, MIN(cost) as mincost FROM tableName GROUP BY Name
What it gives me is the minCost value but it does not give me the right supplier.
😕
How can i get it right? I did try the HAVING clause but that just limited my result set