I have a table like:
file MajorVersion MinorVersion
a 0 1
b 0 1
a 0 2
a 0 3
b 1 0
a 1 0
b 1 1
I would like to get each file’s latest version (highest minor version of the highest major version). In this case:
a 1 0
b 1 1
Its seems possible with two joins and group by file, but I thought there maybe a better way. Maybe by use of having?
Only one join required:
See it on sqlfiddle.