select R.* from Ratings R INNER JOIN (select Account, max(mRating) as MaxRatingForAccount from Ratings GROUP BY Account) Mx ON R.Account = Mx.Account and R.mRating = Mx.MaxRatingForAccount