I have a table in SqlServer 9 with data of the form
Code Number J 0 J 5 J 8 Y 2 Y 8
I’d like to add a column that has a number with the internal sequence of numbers for each code, so that my table looks like this;
Code Number Seq J 0 1 J 5 2 J 8 3 Y 2 1 Y 8 2
Does anyone have any suggestions as to the best way to accomplish this?
Look at the ROW_NUMBER() function.