The sample data is attached.
I have a field course, if i add on the field id bigint identity(1,1) and insert the records all the data will get autonumbering.
But my requirement is the numbering should restart at every course change.
For example the course list is
The order should continue from the last number for every course.