News for hackers. Stuff that matters.
Re:SQL: Select only rows with Max Value on a Column by goldenkey on Tuesday December 31, 2013 @05:35PM (#6993230)
I prefer SELECT table.* FROM table WHERE rev = (SELECT MAX(rev) FROM table WHERE id=table.id)

I hate joins. Subselects are so much clearer imo - and you don't end up with extra fields.

There are no comments on this comment yet.