update 表A set flag=1 where 
(feature1='我')and (feature2='你') and (feature3='他') and (feature4 is null) and (feature5 is null)

解决方案 »

  1.   

    update 表A set flag=1 where 
    (feature1='我')and (feature2='你') and (feature3='他') and (isnull(feature4,'')='') and (feature5 is null)
      

  2.   

    null要用 is null 判断另外,null 与 '' 是两个不同的
      

  3.   

    你先要給表A增加一個字段 FLAG
      

  4.   


    update 表A set flag=1 where 
    (feature1='我')and (feature2='你') and (feature3='他') and (feature4 IS NULL) and (feature5 IS null)
      

  5.   

    请教一个菜鸟问题
       在创建一个表的时候,identity[(seed,increment)]定义该列为标识列。
       请问标识列是什么意思,起什么作用。
      

  6.   

    TO :zjcxc(邹建) 
    update 表A set flag=1 where 
    (feature1='我')and (feature2='你') and (feature3='他') and (isnull(feature4,'')='') and (feature5 is null)
    如果像上面那样处理的话,如果feature1,feature2,feature3,feature4,feature5的值均等于变量(而不是具体的值)
    我们事先根本不知道feature4值是为空,这又要怎么办
      

  7.   

    不会吧你update总得有条件的啊.
      

  8.   

    --不明白事先根本不知道feature4值是为空这是什么意思?--举例说明一下:update 表A set flag=1 where 
    (feature1=@变量1)and (feature2=@变量2) and (feature3=@变量3) and (feature4=@变量4) and (feature5=@变量5)
      

  9.   

    就是说,
    下面的变量值是从数据库表里循环取出来的,可能为空也可能不为空
    变量1=空或某一个值;
    变量2=空或某一个值;
    变量3=空或某一个值;
    变量4=空或某一个值;
    变量5=空或某一个值;update 表A set flag=1 where 
    (feature1=@变量1)and (feature2=@变量2) and (feature3=@变量3) and (feature4=@变量4) and (feature5=@变量5)如果取出来的变量1,变量2,变量3,变量4,变量5均不为空的话,这样flag=1修改就成功了,要是某一个变量的值取出来的是空的话,用上面那句就不行了!
      

  10.   

    update 表A set flag=1 
    where (feature1=@变量1 or (@变量1 is null and feature1 is null))
    and (feature2=@变量2 or (@变量2 is null and feature2 is null))
    and (feature3=@变量3 or (@变量3 is null and feature3 is null))
    and (feature4=@变量4 or (@变量4 is null and feature4 is null))
    and (feature5=@变量5 or (@变量5 is null and feature5 is null))
      

  11.   

    我的SQLserver不知道怎么了(我没有动别的东西),SQLserver的启动服务器不能启动了(我的机子是98系统),但是没有变为灰色的,可以点击。就是不能启动