第一个是:
在表名为“A”中的“B”列中,所有的"C"替换成“D”;第二个是:
在表A列名为“registertime”中,注册时间在比如2000-1-1到2008-12-31,且“B”没有“D”的,在“B”列中加入“E”谢谢啦!!

解决方案 »

  1.   

    --1.
    update A
    set B=replace(B,'C','D')
    where charindex('D',B)>0--2.
    update A
    set B=B+'E'
    where registertime>='2000-01-01' and registertime<'2009-01-01'
    and charindex('D',B)=0
      

  2.   

    --1
    update A set B = replace(B, 'C', 'D') where B like '%C%'--2
    update A set B = B + 'E' where registertime >= '2001-01-01' and registertime < '2009-01-01' and B not like '%D%'
      

  3.   

    1楼这里改改
    where charindex('D',B)>0
    -->
    where charindex('C',B)>0
      

  4.   

    消息 156,级别 15,状态 1,第 1 行
    关键字 'User' 附近有语法错误。注意USER=A不知道错哪了。
      

  5.   

    USER是SQL的关键字,用作对象名称要加方括号引用:[USER]
      

  6.   

    我把USER改成了[USER]
    结果又有某行出现影响。
      

  7.   

    回复7楼的朋友,我已经想到了USER不能用,但是又出先了先问题如8楼
      

  8.   

    另外字段属性全为文本,在这列中,以A,B,C,D的形式进行记录字段
      

  9.   


    update A
    set B=replace(B,'C','D')
    where charindex('D',B)>0
    update A
    set B=B+'E'
    where registertime>='2000-01-01' and registertime<'2008-12-31 23:59:59.667'
    and charindex('D',B)=0
      

  10.   

    --1:
    UPDATE
    SET B=REPLACE(B,'C','D')
    WHERE CHARINDEX('C',B)>0--2:
    UPDATE A
    SET B=B+'E'
    WHERE registertime BETWEEN '2000-1-1' AND '2008-12-31'
    AND CHARINDEX('D',B)<=0
      

  11.   


    --1.
    update A
    set B=replace(B,'C','D')
    where charindex('C',B)>0--2.
    update A
    set B=B+'E'
    where registertime>='2000-01-01' and registertime<'2009-01-01'
    and charindex('D',B)=0