That's not what I was asking. Let me give you an example of what I'm talking about. The second row in the original dataset is id=2, Name='B', Code=2. Now in the expected output, the second row is id=2, Name='B', Code=1. It looks like it's the same row, only its
Code
value is different. So what I'm asking is, do you really want to just
show the rows in a specific order (based on the input), as you say in your question, or do you instead want to
change the values of
Code
according to a specific pattern (based on the input), as your expected output seems to suggest? —
Andriy M 2 mins ago