I've really tried with this problem and it's taking too much of my time now. I just need it to work to demo other features of the program to my students. I and they will not need anything this complex

I have a query where I need to update a table (bids) based on finding a field (design\_code) and the minimum of the bid\_amount

I have gotten as far as this

```
UPDATE Bids a 
INNER JOIN (SELECT DesignCode, MIN(Bid_Amount) AS Bid_Amount 
            FROM Bids 
            WHERE DesignCode = "FT1") AS b 
    ON (a.DesignCode=b.DesignCode AND a.Bid_Amount =b.Bid_Amount) 
SET Bid_Currently_Successful = No 
WHERE a.DesignCode = "FT1" AND a.Bid_Amount =b.Bid_Amount; ');

```

This is based on [SQL Update Table Where date = MIN(date)](https://stackoverflow.com/questions/40171682/sql-update-table-where-date-mindate)

But I get the error: 

> 
> Circular reference caused by Bid\_Amount in select
> 
> 
> 

I think I know why, duplicate names, but don't know which to change

I also get the error: 

> 
> Your query does not include the specified expression 'DesignCode' as aprt of an aggregate function. 
> 
> 
> 

If I do change the AS Bid\_Amount's name