| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Update based on order
Hi Prakash,
sure you can do this. What is your Oracle version? Which columns uniquely define the sort order of your table?
Martin
Prakash C N wrote:
>
> 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 x
Received on Tue Dec 18 2001 - 06:40:14 CST
![]() |
![]() |