NULL value
NULL is a reserved keyword used to indicate that a data value is unknown. It is the ASCII abbreviation for NULL characters (\0
).
Usage in expressions
Vertica does not treat an empty string as a NULL value. An expression must specify NULL to indicate that a column value is unknown.
The following considerations apply to using NULL in expressions:
-
NULL is not greater than, less than, equal to, or not equal to any other expression. Use the Boolean predicate to determine whether an expression value is NULL.
-
You can write queries with expressions that contain the
<=>
operator forNULL=NULL
joins. See Equi-joins and non equi-joins. -
Vertica accepts NULL characters (
'\0'
) in constant strings and does not remove null characters from VARCHAR fields on input or output.
Projection ordering of NULL data
Vertica sorts NULL values in projection columns as follows:
Column data type | NULL values placed at... |
---|---|
NUMERIC INTEGER DATE TIME TIMESTAMP INTERVAL |
Beginning of sorted column (NULLS FIRST ) |
FLOAT STRING BOOLEAN |
End of sorted column (NULLS LAST ) |