Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Update based on order
Hi
can i execute an update statement based on order,
for example
update tab1 set col1 = running_number
where col2 = 1 order by col3 desc
here col1 will be geting a running number that means for each record updated col1 will have the next number
sample output before update
col1 col2 col3
5 1 Z 6 1 a 4 1 T 1 2 Y 2 2 x
sample output after update
col1 col2 col3
4 1 T 5 1 Z 6 1 a 1 2 Y 2 2 xReceived on Sun Nov 25 2001 - 09:27:51 CST
![]() |
![]() |