SELECT title, doc_num, MAX(version) AS version from test GROUP BY title; # For this example "test" is the table name