I have got a table employer_entity
with column tokens
. This column is a varchar
and it contains many tokens splitted by comma, for instance:
id | tokens
---|------------------
1 | aaaaa,bbbbb,ccccc
Now I want to build a query that will check if tokens
column contains the token aaaaa
.
Here is what I've got
select *
from employer_entity
where 'aaaaa'
in (string_to_array(employer_entity.tokens, ','))
But it throws an error
Array value must start with "{" or dimension information.