select Account, max(mRating) as MaxRatingForAccount from Ratings GROUP BY Account ORDER BY Account INTO CURSOR csrMx NOFILTER BROWSE && Just to view the result - comment this later select R.* from Ratings R INNER JOIN csrMx AS Mx ON R.Account = Mx.Account and R.mRating = Mx.MaxRatingForAccount