How to write a query that will match data and produce and identity for it.
For Example:
RecordID | Name 1 | John 2 | John 3 | Smith 4 | Smith 5 | Smith 6 | Carl
I want a query which will assign an identity after matching exactly on Name.
Expected Output:
RecordID | Name | ID 1 | John | 1X 2 | John | 1X 3 | Smith | 1Y 4 | Smith | 1Y 5 | Smith | 1Y 6 | Carl | 1Z
Note: The ID should be unique for every match. Also, it can be numbers or varchar.
Can somebody help me with this? The main thing is to assign the ID's.
Thanks.