I have the following table, I would like to group by ID and if there are consecutively same code, group by them, then pick the minimum valueA and maximun valueB within the group. I couldn't make it work, because if I group by ID and then group by code, then it picks all the same codes within the...