下面不知道是不是你想要的:update table1 
set we=14
where rt<>wr

解决方案 »

  1.   

    誤會我的意思了,rt與wr是兩個不同的條件
      

  2.   

    declare @wr varchar(10)UPDATE table1
    SET we = 14
    WHERE rt = '123' 
      AND case wr when @wr then 1 else case when @wr is null and wr is null then 1 else 0 end end=1
      

  3.   

    你的意思是不是说当wr=''这种情况下会错误,如果说排除这种情况问题就解决了,对吗?
    那可以这样试试:case   when   @变量 is null  then wr is null else wr=@变量 end
      

  4.   

    纠正一下,即使变量也可用isnull或是=null来判断