Suppose I have the following table
MemberTable
ID (1 letter + 5 digits) | Name | Type
And I have the following records
A00000 | Peter | A
B00001 | Amy | B
C00002 | Susan | A
...
Now I need to update all the ID base on the follow criteria:
- All start with
00- - Then comes with 2 digits base on the member type
- Then add back the original ID except the 1st letter
Member type digits mapping
A -> 00
B -> 01
C -> 02
There the following would be the data I suppose to have after update
00-0000000 | Peter | A
00-0100001 | Amy | B
00-0000002 | Susan | A
Suppose the mapping only a document reference, ie. do not have a table store the mapping details.
Any suggested update statement? Thanks for help.