select * from tablename where colname<>''这句查不出来数据是什么原因呢?---注:colname列中都有值,没有为''的!~

解决方案 »

  1.   

    '' 被认为是 null,null使用=、<>任何值都是false。
      

  2.   

    判断<>''要使用is not null
    select * from tablename where colname is not null;
    null详解
      

  3.   

    检查空值使用is null
    null值视为unknown值
      

  4.   

    用is null 或者 is not null   在oracle 中 null 不是任何东西,当然也不是 ''
      

  5.   

    select * from tablename where colname is not null
      

  6.   

    一般来说,俺比较倾向于:select * from tablename where length(colname)>0