I have a table with three columns col_a,col_b and col_c. col_a and col_b has values and col_c has null values. I just want to update the col_c with start sequence of col_a corresponding col_b. Expecting values of col_c is shown below. Using cursor to achieve this scenario.
COL_A COL_B COL_C
1 1 1
2 1 2
3 1 3
4 1 4
5 1 5
6 1 6
7 1 7
8 1 8
9 1 9
10 1 10
101 2 101
102 2 102
104 2 103
106 2 104
107 2 105
108 2 106
110 2 107
201 3 201
202 3 202
203 3 203
204 3 204
205 3 205
301 5 301
302 5 302
305 5 303
306 5 304