我本来想更新一个字段:
我是这样写的:
update a 
set substring(a.x,1,1)='T'
where  条件
我只是想把第一个字母修改了,但是这样写报错,请问这是什么原因,谢谢大家

解决方案 »

  1.   

    本帖最后由 roy_88 于 2011-10-17 10:55:16 编辑
      

  2.   

    函数搞错了,谢谢,不过我一般用的是SUBSTRING
      

  3.   


    update a  
    set x='T'+right(x,len(x)-1)
    where 条件
      

  4.   


    update a  
    set x = substring(a.x,1,1)='T'
    where 条件
      

  5.   


    update a  
    set x = 'T'+substring(a.x,2,len(a.x))
    where 条件或right都可以實現
      

  6.   

    update a   
    set x = substring(a.x,1,1)='T'
    where 条件
      

  7.   

    update a   
    set x ='T'+ right(a.x,len(a.x)-1)
    where 条件
      

  8.   

    update a  
    set x = 'T'+substring(a.x,2,len(a.x))
    where 条件
      

  9.   

    update a   
    set x = 'T'+substring(a.x,2,len(a.x))
    where x>'' and 其他条件
      

  10.   

    update a   
    set x = 'T'+right(x,len(x)-1)
    where x>'' and 其他条件
      

  11.   

    个人习惯还是喜欢这样写:
    update a   
    set x = 'T'+substring(a.x,2,len(a.x))
    where 条件