I have a table with a structure very similar to this:
ORDRNMBR,ORDRVRSN,ORDRDATE,ORDRAMNT where in this case each order may have multiple versions and hence the need for the ORDRVRSN field.
If it were not for that field a simple SELECT SUM(ORDRAMNT) would do. However for the 5% of the orders that do have multiple versions when it comes to summing I only want the order amount associated with the highest version number. So my question is what is the proper syntax to only include the highest version number for these orders while also including all the other orders in the total.