I'm trying to get the following condition:
Each LID is associated with multiple BID and each BID has an AvgTrustValue.
I wish to find a BID with the lowest AvgTrustValue for each LID

I've done the following: 

```
SELECT DISTINCT LID, T1.BID, AvgTrustValue
FROM Loans T1, Repayments T2, 
    (SELECT BID, AVG(trust_value) As AvgTrustValue
    FROM Assign
    GROUP BY BID) T3
WHERE T1.LoanID = T2.LoanID
AND T1.BID = T3.BID
ORDER BY LID

```

However it only gives me the following:

```
|   LID    |    BID    |
|S2262450A | S7444319C | 82
|S2848191X | S7611209X | 76
|S2848191X | S9981233W | 100
|S4495282I | S7444319C | 82
|S4792394D | S7444319C | 82
|S4792394D | S7611209X | 76
|S7145303Q | S7611209X | 76
|S7173102K | S7444319C | 82

```

What I wish to get is the following:

```
|   LID    |    BID    |
|S2262450A | S7444319C | 82
|S2848191X | S7611209X | 76
|S4495282I | S7444319C | 82
|S4792394D | S7611209X | 76
|S7145303Q | S7611209X | 76
|S7173102K | S7444319C | 82

```

I have also tried the following but failed:

```
SELECT DISTINCT LID, T1.BID, min(AvgTrustValue)
FROM Loans T1, Repayments T2, 
    (SELECT BID, AVG(trust_value) As AvgTrustValue
    FROM Assign
    GROUP BY BID) T3
WHERE T1.LoanID = T2.LoanID
AND T1.BID = T3.BID
GROUP BY LID
ORDER BY LID

```

Thank you so much.