我的一个字段F,本来应该是"/2005/01/30/A01302.jpg"存成了“/2005/01/30A01302.jpg",
F字段有一些值是NULL,求修正的SQL,偶是DB新手,HELP!

解决方案 »

  1.   

    update ta
    set f = case when f is not null then left(f,11)+'/'+right(f,10) else null end
      

  2.   

    update tb set f = replace(f,'/30/A0' , '/30A0')
      

  3.   

    谢谢,我先试下,感觉OFFSET不大对呀
      

  4.   

    update tb
    set f = replace(f,left(f,11),left(f,11)+'/')
    where f is not null
      

  5.   

    update 表名
    set f = case when f is not null then left(f,11)+'/'+substring(f,12,len(f)-11) else null end
    看看,这样是不是可以
      

  6.   

    update 表名
    set f = replace(f,'/30A0' , '/30/A0')