请教:
我有个表,需要查询某个字段下的值不为空的全部字段,字段为文本.
Select * from 表 where (字段 is not null)
我用这个查询出来的结果不对,
请高手指点

解决方案 »

  1.   

    Select * from 表 
    where len(字段)>0文本格式的判断NULL 不好用
      

  2.   

    你的语句是对的;空值和空字符串是两马事,它是两个不同的值
    Select * from 表 where (字段 is not null) 

    Select * from 表 where 字段=''
    结果是不一样的
      

  3.   

    感谢回复
    我使用 Select * from 表 where (字段 is not null) 
    查询出来的语句字段下面是空和不是空,都查询出来了where isnull(col,'') <>''
    这个语句不太理解,麻烦解释一下,谢谢
      

  4.   

    isnuu(col,''是一个函数,它判断col列石头为null,若是的话,就用''把它替换掉
    isnull(col,'')<>'')的意思就是不等于''
      

  5.   

    where col is not null and col <>''跟这个差不多
      

  6.   

    在计算机世界中NULL , "", "  " 是不同的! 分别为 空,空字符串,和空白字符串。
      

  7.   


    Select * from 表 where (字段 is not null and 字段 <> '')