I have a table with duplicate values. They are transactions on a same serial number of a machine. I want to change a field (or add a new one) on which group they belong to.
Some of these records have an assigned group... Some dont. The rule is, if the last 2 transactions are of the same or different group, the serial number is assigned to that group... And it has to be two consecutive transactions... The latest transactions. If there is one transaction that is the last but the previous two would make it assign to a group, it would stay with that group.
Any thoughts on how I can make that happen?
I have to admit, i dont know sql that well. The ideal would be in query builder... But I can always tinker with sql if I had a bit of a road map.