当前位置: 代码迷 >> Oracle开发 >> 小弟我想知道这算不算是oracle中的bug
  详细解决方案

小弟我想知道这算不算是oracle中的bug

热度:74   发布时间:2016-04-24 07:00:27.0
我想知道这算不算是oracle中的bug
首先创建一张表格
create table test (a number)

然后查询
select nvl(a,0) from test

按照理论结果应该是0,而不是如图所示的结果
Oracle nvl? ?bug?

------解决方案--------------------
hr@ORCL> create table test (a number);

Table created.

hr@ORCL> select nvl(a,0) from test;

no rows selected

hr@ORCL> insert into test values(NULL);

1 row created.

hr@ORCL> select nvl(a,0) from test;

  NVL(A,0)
----------
         0

------解决方案--------------------
空行和空值(NULL)是两码事喔
  相关解决方案