Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Update based on order

Update based on order

From: Prakash C N <prakashcn_at_hotmail.com>
Date: 25 Nov 2001 07:27:51 -0800
Message-ID: <7e1c2f8c.0111250727.d1afdc1@posting.google.com>


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 Sun Nov 25 2001 - 09:27:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US