I have an array['a', 'b', 'c']
Very simply I want to check whether all elements of the above array exist in a column say test
of a table t
.
It would be best if the sql return boolean.
Thanks.
I have an array['a', 'b', 'c']
Very simply I want to check whether all elements of the above array exist in a column say test
of a table t
.
It would be best if the sql return boolean.
Thanks.
2
Answers
so I have done it in the following way
please do suggest if there is other optimum way of doing it
You can use Postgresql UNNEST function and EXCEPT function, it is more optimal if your array is large.