IS NAN Predicate
An IS NAN
predicate determines whether an expression is the undefined result of an operation (that is, is "not a number" or NaN
).
SQL syntax
Expression
IS [NOT] NAN
Parameters
Parameter | Description |
---|---|
|
Expression to test. |
Description
-
An
IS NAN
predicate evaluates toTRUE
if the expression is "not a number." -
An
IS NOT NAN
predicate evaluates toTRUE
if expression is not "not a number." -
The expression must either resolve to a numeric data type or to a data type that can be implicitly converted to a numeric data type.
-
Two
NaN
("not a number") values are equal to each other. -
Expressions containing floating-point values may generate
Inf
,-Inf
, orNaN
. This can occur either because the expression generated overflow or exceptional conditions or because one or more of the values in the expression wasInf
,-Inf
, orNaN
.Inf
andNaN
are generated in overflow or division by 0 conditions. -
Inf
,-Inf
, andNaN
values are not ignored in aggregate functions.NULL
values are. If you want to excludeInf
andNaN
from aggregates (or from any selection), use both theIS NOT NAN
andIS NOT INFINITE
predicates. -
NaN
("not a number") sorts higher than all other values including positive infinity, but lower than theNULL
value. -
See "INF and NAN" for more information on
Inf
andNaN
.