help on update progressive!!!!
Hi
I've table TAB_PROG with 1000 record but only with 8 progressive:
ID_NUM..........MY_DATE...............PROGRESSIVE
1.................10/01/2006.................1
2.................12/01/2006.................2
20................13/01/2006.................3
34................15/01/2006.................4
44................17/01/2006.................5
55................18/01/2006.................6
67................19/01/2006.................7
77................20/01/2006.................8
49............................................
89...........................................
90...........................................
98...........................................
111..........................................
222..........................................
I'd like to increment the column progressive by 1, starting from max value (=8)
ID_NUM..........MY_DATE...............PROGRESSIVE
1.................10/01/2006.................1
2.................12/01/2006.................2
20................13/01/2006.................3
34................15/01/2006.................4
44................17/01/2006.................5
55................18/01/2006.................6
67................19/01/2006.................7
77................20/01/2006.................8
49...........................................9
89...........................................10
90...........................................11
98...........................................12
111..........................................13
222..........................................14
...............................................
...............................................
...............................................
...............................................
...............................................
I tried this:
update tab_prog set progressive =
(select prog from
(select id_num,rownum prog from
(select id_num from tab_prog order by id_num)
) rn where rn.id_num=tab_prog.id_num
);
but I don't want update also progressive that are already assigned.
I'd like to start from max progressive.
How can I UPDATE my table TAB_PROG to increment the column progressive by 1?
Thanks in advance!