title: Oracle - updating a sorted table
body: <p>I found an old table without a primary key, and in order to add one, I have to add a new column and fill it with sequence values. I have another column which contains the time of when the record was created, so I want to insert the sequence values to the table sorted by the column with the time.</p>
  
  <p>I'm not sure how to do it. I tried using PL\SQL - I created a cursor for a query that returns the table with an ORDER BY, and then update for each record the cursor returns but it didn't work. </p>
  
  <p>Is there a smart working way to do this?</p>
  
  <p>Thanks in advance.</p>