Maybe it's one of these (untested): SELECT title, doc_num, version FROM foo ORDER BY version DESC LIMIT 1 SELECT title, doc_num, MAX(version) AS maxver FROM foo GROUP BY title ORDER BY maxver DESC