| Column A |
character varying[]
| ------------------------ |
| {value1,value2,value3} |
Tried with select * from some_table where columnA LIKE '%value1%
‘ but it returns error.
Then tried filtering expected value by using select columnA from some_table but now it returns nothing.
3
Answers
Unnest
columnA
array and check if the target value (value11
in the example below) exists.t
CTE is a mimic of the real table.You should to use
= ANY(array)
predicateSee related doc https://www.postgresql.org/docs/current/functions-array.html
If you want to use indexes, you’d query like this:
The index would be