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] NANParameters
| Parameter | Description |
|---|---|
|
|
Expression to test. |
Description
-
An
IS NANpredicate evaluates toTRUEif the expression is "not a number." -
An
IS NOT NANpredicate evaluates toTRUEif 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.InfandNaNare generated in overflow or division by 0 conditions. -
Inf,-Inf, andNaNvalues are not ignored in aggregate functions.NULLvalues are. If you want to excludeInfandNaNfrom aggregates (or from any selection), use both theIS NOT NANandIS NOT INFINITEpredicates. -
NaN("not a number") sorts higher than all other values including positive infinity, but lower than theNULLvalue. -
See "INF and NAN" for more information on
InfandNaN.