select * from CERTSTORAGE t where t.saleperson!=''
我数据中有一条saleperson有值,但是始终查询不到一条记录

解决方案 »

  1.   

    select * from CERTSTORAGE t where t.saleperson is not null 
      

  2.   

    不等!=和<>都可以
    select * from CERTSTORAGE t where t.saleperson is not null or trim(t.saleperson)=''
      

  3.   

    空值没有大小,自然不能进行大于、小于、等于运算。
    而只能进行is null,is not null的判定
      

  4.   

    select * from CERTSTORAGE t where t.saleperson is not null
      

  5.   

    比如说,我所有数据都是空字符串,而不是空,t.saleperson!=''也是查询不到的,
      

  6.   

    空字符就是null了 select * from CERTSTORAGE t where t.saleperson is not null 这样也查不到?
      

  7.   

    不等于 != 倒也可以,但按lz的意思 应该写成is not null
      

  8.   

     is not null 不为空
    is null 为空
      

  9.   

    我也遇到过这样的情况,你把* 去掉。写具体的列看看。
    我上次select count(*) from table_name where hp is null,就是显示的0
    后来改成select count(id) from table_name where hp is null,就显示1了!
      

  10.   

    1、is null 为空;
    2、is not null 不为空;
    3、‘’空格不是空值。
      

  11.   

    0长度字符串等同于null,不能直接用等号判断,要用is null判断
      

  12.   

    只是在oracle中是这样,sqlserver就能判断!=''