NULL is not equal to any other value
When comparing two expressions and at least one of these expressions is
null
, Oracle considers the expressions to be different. (The only
exception to this rule I can think of is the
decode
statement).
Because a comparison that involves null
is always false, the following statement returns 0:
select count(*) from dual where null = null;
The undocumented function
sys_op_map_nonnull
allows to mitigiate this nuisance: the following query returns 1:
select count(*) from dual where sys_op_map_nonnull(null) = sys_op_map_nonnull(null);
Zero length strings are NULL
select count(*) from dual where '' is null;
Unlike in
SQL Server however, a string can be concatenated with the null value
without the entire expression becoming null.
Because empty strings are equivalent to
null
, it's impossible to create empty
JSON strings.