IN_LIST
All functions > COMPARISON > IN_LIST
Returns TRUE if a value exists in a list of values.
Syntax
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 found in the list, FALSE otherwise
Notes
- Value and list elements must be of compatible types
- Returns TRUE if any element in the list matches the value
- Returns FALSE if the value is not 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 OR conditions with equality checks
- More concise than:
value = val1 OR value = val2 OR ...
- Can be used with operator syntax:
value IN (val1, val2, ...)