求A != 1 and B != 2 以外的记录

解决方案 »

  1.   

    a!=1 and b!=2 以外?那岂不是a=1或者b=2的这种情况么select * from table where a = 1 or b = 2
      

  2.   

    如果是A != 1 and B != 2的话
    select * from table where a <> 1 and b <> 2
      

  3.   

    where not(A!=1 and B!=2)
      

  4.   

    A != 1 and B!= 2
    它的反义就是:
    A = 1 or B = 2
      

  5.   

    你的描述存在歧义
    如果是“求A != 1” and“ B != 2 以外的记录”
    条件就写
    where a!=1 and not(b!=2)
    当然你也可以写成where a!=1 and b=2
    你根据需要修改下
      

  6.   

    A != 1 同时 B!= 2 以外的情况情况1:
    (A != 1 同时 B!= 2)以外的情况,则
    a = 1 or b = 2 or a is null or b is null;情况2:
    A != 1 同时 (B!= 2以外)的情况,则
    a != 1 and (b = 2 or b is null);离散数学书上有。