Hi Experts I have a database of beverages, with following tables: Beverage (code, name, size) Primary key=code Store (name, area, phone) Primary key=name Sells (store_name, code, price) store_name refers to name(store) and code to code(beverage). I need to find the code and name of the least expensive beverages for each store (1 value per store), but I am only able to find minimum price per store without the code via: SELECT store_name, MIN(price) FROM Sells GROUP BY store_name ORDER BY min(price) This gives me the store name and price of the least expensive beverages, but I need to somehow combine this with the Beverage table, so I get code and name also. Can anyone help me?
something like this: Select Beverage.code, Beverage.name, store.name from Beverage, Store Where (code,store_name) in (Select code, store_name from Sells Where (store_name,price) in (SELECT store_name,MIN(price) FROM Sells GROUP BY store_name ))