Hi guys,
Oracle 11.2
I just found this by chance:
SQL> create table tab_0417(fid number, fdate date);
Table created
SQL> insert into tab_0417 values(1, date'2012-01-01');
1 row inserted
SQL> insert into tab_0417 values(1, NULL);
1 row inserted
SQL> commit;
Commit complete
SQL> select fid, fdate, nvl2(fdate, sysdate-fdate, sysdate) from tab_0417;
FID FDATE NVL2(FDATE,SYSDATE-FDATE,SYSDA
---------- ----------- ------------------------------
1 1/1/2012 107.580358796296
1 2456035.5803588
I expected an exception since the second and the third parameter of NVL2 have different data types and cannot be converted implicitly. But it executed successfully, and got a strange number 2456035.5803588, could anyone explain it?
Thanks in advance.