CONTAINS (array)

Function CONTAINS is also found in the following categories: String functions.

Syntax

CONTAINS( array, value )

Description

Returns TRUE if array contains value.

Argument types:

  • arrayArray of fractional numbers | Array of integers | Array of strings
  • valueFractional number | Integer | String

Return type: Boolean

Example

[array] [value] CONTAINS([array], [value])
'[1,2,3]' 2 True
'[1,2,3]' 4 False

Data source support

ClickHouse 21.8, PostgreSQL 9.3.