Update SQL with consecutive numbering

前端 未结 10 587
庸人自扰
庸人自扰 2020-12-02 20:16

I want to update a table with consecutive numbering starting with 1. The update has a where clause so only results that meet the clause will be renumbered. Can I accomplish

10条回答
  •  一生所求
    2020-12-02 20:40

    In oracle this works:

    update myTable set rowColum = rownum
    where something = something else
    

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/pseudocolumns009.htm#i1006297

提交回复
热议问题