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

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

See also

Examples

Numeric values

String values

Other types

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