本帖最后由 luandepin 于 2012-10-14 22:31:03 编辑

解决方案 »

  1.   

    如果更新的没有超过100的话,可以使用lpad函数帮你。update a set intid=lpad(intid+1,'2','0')
    或者update a set intid=case when intid>0 and intid<9 then lpad(intid+1,2,'0')
      else to_char(intid+4) end
      

  2.   

    如果想要算出来的结果和原来位数相同 固定位数 左边加0就可以了
    update table set A=lpad(A+1,length(A),0) where ...
      

  3.   

    如果想要算出来的结果和原来位数相同 固定位数 左边加0就可以了SQL code
    update table set A=lpad(A+1,length(A),0) where ...这样不行!99到100的时候会出问题
      

  4.   

    update table set A=lpad(A+1,length(A)-length(to_char(to_number(A))) + 1 ,0) 
     where .... 
      

  5.   

    判断下吧  这样看可以不
    update table set A=lpad(A+1,decode(sign(length(A+1)-length(A)),1,length(A+1),length(A)),0) where ...
      

  6.   

    对不起,我在4#的回复是错的。下面的应该可以: update table set A=lpad(A+1,greatest(length(A),length(A+1)),0) where