Skip to content

Tag: tsql

How to replace identical values with incremental integers?

I have this SQL select: The output will look something like this: How can I replace the identical values of UserId with incremental integers, so that the output will look something like this: I have tried grouping the identical UserId rows first then joining it with the same table while having an incremental …