NOT_IN_LIST
All functions > COMPARISON > NOT_IN_LIST
Returns TRUE if a value does NOT exist in a list of values.
Syntax
NOT_IN_LIST(expr, list_of_exprs)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
value | BIGINT | Yes | Expression to search for |
list_of_values | ARRAYBIGINT | Yes | Array or list of values to search in |
Returns
BOOLEAN - TRUE if value is not found in the list, FALSE otherwise
Notes
- Value and list elements must be of compatible types
- Returns TRUE if the value does not match any element in the list
- Returns FALSE if the value is found in the list
- NULL handling: if value is NULL, returns NULL; if any list element is NULL and value doesn't match other elements, returns NULL
- Equivalent to multiple AND conditions with inequality checks
- Opposite of IN_LIST function
- More concise than:
value != val1 AND value != val2 AND ...
- Can be used with operator syntax:
value NOT IN (val1, val2, ...)