Sunday, December 13, 2009

Decode and NULL

As a rule, comparison to NULL should always return NULL. However, DECODE is an exception as it evaluates NULL == NULL

SQL> SELECT decode(null,null,1,0) FROM dual;
DECODE(NULL,NULL,1,0)
---------------------
1

No comments: