I have a table like this
| id | dept |
|---|---|
| 1 | a |
| 1 | b |
| 1 | b |
| 2 | a |
| 2 | b |
And I'd like to rename values like this
| id | dept |
|---|---|
| 1 | a |
| 1 | b1 |
| 1 | b2 |
| 2 | a |
| 2 | b1 |
All values in dept are grouped by id, same departments repeat each group. I'm unsure how to make a loop that does one pass per id (replace 'b' with 'b1'), then a second pass (replace 'b' with 'b2').
Or does once per table, but each statement ends after one replace per id.
Thanks in advance!
idis not unique, so it can't be a PK. That's the problem here.