Or those who happen to be using a dialect of sql with window functions, selecting the rows where:<p>ROW_NUMBER() OVER(PARTITION BY Id ORDER BY Rev DESC) AS "Row Number"<p>Returns 1 is clearer to my mind, with some caveats around dialects which use separate forms of row-number that assign identical/differing numbers to two consecutive identical rows.