Find rows where text array contains value similar to input

前端 未结 4 1262
失恋的感觉
失恋的感觉 2020-12-06 18:44

I\'m trying to get rows where a column of type text[] contains a value similar to some user input.

What I\'ve thought and done so far is to use the

4条回答
  •  没有蜡笔的小新
    2020-12-06 19:05

    Please check this out.

    This answer was exactly what I was looking for. It also provides for some useful tips (and examples) in case you need more flexibility.

    It basically explains the ANY(), the @> and the && operators.

    "If you want to search multiple values, you can use @> operator"

    "@> means contains all the values in that array. If you want to search if the current array contains any values in another array, you can use &&"

提交回复
热议问题