Column 'dbo.IIRPS_HPOO_LPAR.OnlineMemory' is invalid in the HAVING clause because it is not contained in either an aggregate function or the GROUP BY...
I need to sort all the rows and then select the first 15 with the smallest height difference. Your method selects the first 15 and then sorts them. ...