SELECT * FROM Kidney a -- JOIN and create the derived table JOIN (SELECT Age, MAX(BloodPressure) AS MaxBloodPressure FROM Kidney GROUP BY Age) b -- JOIN on BloodPressure