I have a table with wines- name, type, price and I'm trying to select the cheapest wine from each type.

I have this query to get the min price of each category:

```
SELECT DISTINCT wine.WineType, MIN(wine.Price) OVER(PARTITION BY wine.WineType) as MinPrice
FROM wine;

```

Which outputs:

[![table with of distinct wine types on the left and minimum price for each type
on the right](https://i.stack.imgur.com/3V8Dz.png)](https://i.stack.imgur.com/3V8Dz.png)

My failed attempt to add wine name to the cheapest price looks like this:

```
SELECT DISTINCT wine.WineType, MIN(wine.Price) OVER(PARTITION BY wine.WineType),
(SELECT wine.WineName 
FROM wine 
WHERE wine.Price = (SELECT MIN(wine.Price) OVER(PARTITION BY wine.WineType))
FROM wine;

```

How can I connect the name field to each of the output rows?