测试数据如下:tb:
a   b    c
1   2    x1   3    null1   4    1   5    x语句
select * from tb where c<>'x' 结果为:a   b   c
1   4   
为什么null的不会被取出来数据库为sql server2000还有,请将以下count(1)和count(*)的区别谢谢

解决方案 »

  1.   

    select * from tb where isnull(c,'')<>'x'
      

  2.   

    select * from tb where c<>'x' or c is null
      

  3.   

    select * from tb where isnull(c,'a')<>'x'
      

  4.   

    count(1)和count(*) 结果一样,效率不同.
      

  5.   

    select * from tb where c<>'x' or c is null
      

  6.   

    请将以下count(1)和count(*)的区别如果所有的列都不是null,则一样.
      

  7.   


    一般理解的话是不等于某个值的话是包括null的,是不是null值只能用is去比较,不能用=去比较?
      

  8.   

    是不是count(*)会过滤null值,count(1)不会?
      

  9.   

    count(*)和count(1)都会过滤null值
    count(name)不会