I have a table structured as such:
customerid, productid, price
I would like to extract the minimum price for each product and which supplier it is.
this is my code so far:
SELECT supplierid, productid, min(price) FROM `sup_prices` group by price order by productid
This gives me all the records.
Any idea how to modify this code to do what I need?
customerid, productid, price
I would like to extract the minimum price for each product and which supplier it is.
this is my code so far:
SELECT supplierid, productid, min(price) FROM `sup_prices` group by price order by productid
This gives me all the records.
Any idea how to modify this code to do what I need?