有没有?貌似没有哎

解决方案 »

  1.   

    Oracle中空字串是单引号''中的,不是双引号"" 
      

  2.   

    好像是没有 但是' '和 null 是有区别的
      

  3.   

    在oracle中null就是null表示 啥都不是null<>null而''也就是null只能用is null来检测!
      

  4.   

    ''和null没区别;
    ' '和null有区别。
      

  5.   

    有区别啊,
    ‘’<>null 
    '' is null
    ' ' <> null
    ' ' is not null
      

  6.   

    哎?那
    where fieldA = ''

    where fieldA = NULL检索出来的数据为什么不一样???
      

  7.   

    null的比较从来不是用=的.判断null要使用is null 和is not null
      

  8.   

    SQL> select 1 from dual where '' is null;
     
             1
    ----------
             1
     
    SQL> 
      

  9.   

    不能有等于 要用  is null 
      

  10.   

    有区别。。
    NULL  就是 什么都没有
    '' 至少表示这个字段是char类型  或者 varchar 类型。
      

  11.   

    '' 跟意义是一样的但是用的时候不一样
    id=''
    or
    id is null
      

  12.   

    id=""是把ID当做空值来判断啊
    这里的id is null不是当空值来对待啊,应该是空对象。含义不一样。
      

  13.   

    啊,跟SQL server 还是有差别的哈,谢谢各位热心回帖。
      

  14.   

    SQL> create table t (id number,name varchar2(10));
     
    Table created
      
    SQL> insert into t values(1,'');
     
    1 row inserted
     
    SQL> select * from t where name='';
     
            ID NAME
    ---------- ----------
     
    SQL> select * from t where name is null;
     
            ID NAME
    ---------- ----------
             1 
     
    SQL> 
      

  15.   


    一、在ORACLE数据库存储中的''和NULL是没有区别的。可以通过以下的方式测试:
    UPDATE 表 SET 字段 = '' WHERE ......
    然后
    SELECT * FROM 表 WHERE 字段 IS NULL;
    是能取出刚才设为''的记录的,可以证明在存储中''与NULL没有区别。二、在存储过程等代码中''和NULL也是没有区别的。可以能过以下方式测试:
    创建以下的函数,然后进行测试:
    create or replace function f_test return number is
    str varchar2(10);
    begin
      str := '';
      if str is null then
        return 0;
      else
        return 1;
      end if;
    end;
    该函数的返回值为0,可以证明在存储过程中''和NULL没有区别。
      

  16.   

     I agree with this opinion!
      

  17.   

    只能说  含义上应该是有区别的 一个是空白 一个是什么都不是但是 使用的时候 ''就是 null 通过where条件就看出了
      

  18.   

    你们还真有精神头,
    我都结贴了,还这么多人回帖。你们别瞎琢磨了,
    在ORACLE里,''和NULL在使用上,没有区别。