1SELECT t1.*
2FROM employees t1
3INNER JOIN (
4 SELECT id, max(salary) AS salary FROM employees GROUP BY id
5) t2 ON t1.id = t2.id AND t1.salary = t2.salary;
1SELECT a.id, a.rev, a.contents
2FROM YourTable a
3INNER JOIN (
4 SELECT id, MAX(rev) rev
5 FROM YourTable
6 GROUP BY id
7) b ON a.id = b.id AND a.rev = b.rev
8