If an attribute value is missing for a record, then the attribute is referred to as being NULL. For example, if a record does not contain an assignment for a Price attribute, EQL defines the Price value as NULL.
Type of operation | How EQL handles NULL values |
---|---|
Arithmetic operations and non-aggregating functions | The value of any operation on a NULL value is also defined as NULL.
For example, if a record has a value of 4 for Quantity and a NULL value for Price, then the value of |
Aggregating functions | EQL ignores records with NULL values.
For example, if there are 10 records, and 2 of them have a NULL value for a Price attribute, all aggregating operations ignore the 2 records, and instead compute their value using only the other 8 records. If all 10 records have a NULL Price, then most aggregations, such as The exceptions are |
Boolean operators | See Boolean operators. |
Grouping expressions | EQL does not ignore records that have a NULL value in any of the group keys, and considers the record to be present in a group. Even all-NULL groups are returned. |
Filters | When doing a comparison against a specific value, the NULL value will not match the specified filter, except for the IS NULL filter.
Note that:
For example, if record A has price 5, and record B has no price value, then:
|
Sorting | For any sort order specified, EQL returns:
|
Note:
There is no NULL keyword or literal. To create a NULL, useCASE
, as in this example: CASE WHEN False THEN 1 END
.