9951 explained code solutions for 126 technologies


clickhouseSelect rows with certain value in array column


SELECT * FROM tbl3 WHERE has(list, 'd')ctrl + c
tbl3

table with array column in it

has

will return true if specified array column has specified value in it

list

name of the array column

'd'

value to search in array


Usage example

SELECT * FROM tbl3 WHERE has(list, 'd')
output
┌──────────────────ts─┬─list──────────┐
│ 2022-01-14 17:41:38 │ ['b','c','d'] │
└─────────────────────┴───────────────┘