In Oracle Null is not equal to null :) !!!!!!!!!!
select case when null = null
then 1 ----true
else 2 ----flase
end
from dual ;
CASEWHENNULL=NULLTHEN1----TRUEELSE2----FLASEEND
-----------------------------------------------
2 ---- so false
so you can not equate the null with null ( null=null) --<<--- false
select decode(null,null, 1, 2) from dual; --<<<<--- in decode
DECODE(NULL,NULL,1,2)
---------------------
1 <<<---- true
select case when null = null
then 1
else 2
end "Case",
decode(null,null, 1, 2) "Decode" from dual
SQL> /
Case Decode
---------- ----------
2 1
SELECT * FROM dual WHERE NULL = NULL;
No rows selected.
SELECT * FROM dual WHERE NULL <> NULL;
No rows selected.
Search This Blog
Total Pageviews
Saturday, 15 October 2011
Subscribe to:
Post Comments (Atom)
Oracle DBA
anuj blog Archive
- ▼ 2011 (362)
No comments:
Post a Comment