经过试验,oracle中对于‘’的处理是null,然而空字符串必须是有个空格。
那么请问下面的结果应该是true还是false?
nvl('', '') = ''  个人分析''就是null,那么null=null,不可以么,是不是不应该这样写

解决方案 »

  1.   

    你可以试试
    select 1 from dual where nvl('', '') = ''nvl('','')虽然返回的是空值,但是空值不能用=来比较
    改成
    select 1 from dual where nvl('', '') is null
      

  2.   

    SQL> select 1 from dual where nvl('', '') = ''
      2  ;no rows selectedSQL> select 1 from dual where nvl('', '') is null
      2  ;         1
    ----------
             1另外,楼主所说的null=null,返回应该是FALSE。你只要记住NULL不等于任何值就是了,也不等于NULL。