SELECT groupfield, SUM(somedata) FROM tablename GROUP BY groupfield #### SELECT groupfield, MAX(somedata) FROM tablename GROUP BY groupfield