sql >> Databasteknik >  >> RDS >> Oracle

Uppdatera hela tabellen med sekvensnummer i oracle

merge into foo
using
(
   select rowid as rid,
          row_number() over (order by date_value) as seqno
   from foo
) t on (foo.rowid = t.rid)
when matched then update
   set srno = t.seqno;

SQLFiddle-demo:http://sqlfiddle.com/#!4/d8cc5/2



  1. Laravel 5 databasproblem

  2. Mysql-vallista efter ett specifikt id

  3. Skickar SentryOne-data till Azure SQL Database DTU Calculator

  4. ActiveRecord kapslad SELECT