我想把数据库某表 的 LINKID 列 UPDATE 为 1.00 2.00 一直排序到最后一行 2773.00 怎样写这SQL语句?

解决方案 »

  1.   

    LINKID
    1.00
    2.00
    ...
    2773.00
    想更新为这样的。
      

  2.   


    LINKID
    1.00
    2.00
    ...
    2773.00
    想更新为这样的。
      

  3.   

    update 
    tb_name t1
    set t1.linkid=(select t2.rn from (select rowid, row_number() over(order by rowid) as rn from tb_name) t2 where t2.rowid=t1.rowid);
      

  4.   

    --linkid是什么类型的?
    update tb set linkid=rownum
      

  5.   

    +1,number字段类型不管有没有小数位都可以这样更新