Is it possible to group by uuid to find max version and then filter for flag? I am expecting to find the version 3 first and then see if it has got flag "Y" on it.