where not a is null and a<>''
意思就是取出所有a列有内容的记录,但是这样什么也出不来,只能写成where not a is null才有记录,但是这样如果把a值设为空字符串,又出不来了

解决方案 »

  1.   

    where   not   a   is   null   and   a <> '' 
    改为
    where a is not null and a <> ''
      

  2.   

    oracle里面的 '' 就是 null
    T@ora>create table a(a varchar(10));Table created.Elapsed: 00:00:00.01
    T@ora>insert into a values(null);1 row created.Elapsed: 00:00:00.00
    T@ora>insert into a values('');1 row created.Elapsed: 00:00:00.00
    T@ora>select * from a where a is null;A
    ----------Elapsed: 00:00:00.06
    T@ora>select count(*) from a where a is null;  COUNT(*)
    ----------
             2Elapsed: 00:00:00.04
    T@ora>select dump(a) from a;DUMP(A)
    ----------------------------------------------------------------
    NULL
    NULL
      

  3.   

    oracle 有Isnull吗?
    where isnull(a,'')<>''
      

  4.   

    oracle
    where   nvl(a,'') <> ''