Finding the sum of the lowest two values from a table in MySQL Using two tables, I am trying to show the years where the average price from Table1(Green_Certs) is greater than the sum of the lowest two prices from Table2(Trading).  The problem is I don't know how to Sum the two lowest values from the second table.  This is my code so far.  Any help is appreciated. Thanks

Select Year_Traded
From Green_Certs
Where Avg(Price)&gt;
(Select min(Price)
     From Trading);
SELECT Price
    FROM Trading
    ORDER BY Price
    LIMIT 2;


will find the 2 lowest values.

Wrap that to get the SUM (or AVG or whatever):

SELECT SUM(Price) as sum_price
    FROM ( SELECT Price
            FROM Trading
            ORDER BY Price
            LIMIT 2 )


Then (I think) use that instead of the subquery you have.