update tablename set cid ='0003'+right(cid,len(cid)-4) where cid like '0001%'

解决方案 »

  1.   

    update tablename set cid =stuff(cid,1,4,'0003') where cid like '0001%'
      

  2.   

    update tablename set cid =Stuff(cid,4,1,'3') where cid like '0001%'
      

  3.   

    我想截取的是右边的所有字符啊,怎么办?
    如:
    原分类(cid):
    0001
    0002
    0003
    000101
    000102
    00010101
    0001010201
    000101030101
    即是将前面的0001替换成0003后,得到剩余的所有的字符串。
    不用stuff,因为我用的是ACCESS数据库。
    谢谢!!!
      

  4.   

    oid是指定字符串(如0003)的长度,用下面的这个为什么不行呢?
    update tablename set cid ='0003'+right(cid,len(cid)-len(oid)) where cid like '0001%'