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

ParameterTypeRequiredDescription
valueBIGINTYesExpression to search for
list_of_valuesARRAYBIGINTYesArray 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, ...)

See also

Examples

Numeric values

String values

Other types

Last update at: 2025/10/13 10:23:46