Null Values
All scalar data types in APL have a special value that represents a missing value. This value is called the null value, or null.
- The
string
data type doesn't support null values.
Null literals
The null value of a scalar type D is represented in the query language by the null literal D(null). The following query returns a single row full of null values:
print bool(null), datetime(null), dynamic(null), guid(null), int(null), long(null), real(null), double(null), time(null)
Predicates on null values
The scalar function isnull() can be used to determine if a scalar value is the null value. The corresponding function isnotnull() can be used to determine if a scalar value isn't the null value.
Equality and inequality of null values
- Equality (
==
): Applying the equality operator to two null values yieldsbool(null)
. Applying the equality operator to a null value and a non-null value yieldsbool(false)
. - inequality(
!=
): Applying the inequality operator to two null values yieldsbool(null)
. Applying the inequality operator to a null value and a non-null value yieldsbool(true)
.