I have a table which does versioning with an ID and a GUID.
The ID increases, but the GUID is static allowing for versioning control.
For example:
ID GUID Data
01 ASD Something
02 ASD Something Changed
03 ASD Something Changed Again
04 DSA Something Else
05 DSA Something Else Changed
So the question is, how do you get the latest data, so you end up with:
03 ASD Something Changed Again
05 DSA Something Else Changed
You could also try
You should probably try to performance check a couple of solutions ( such as the one provided by @Rubens Farias) , and see what works best for you given the indexes you have.