【发布时间】:2020-11-04 19:36:08
【问题描述】:
我目前在这样的字符串中搜索多个单词:
select name from restaurant where regexp_split_to_array(lower(name), '\s+') @> array['bar', 'food'];
将字符串拆分为这样的数组: The Food Bar = [the, food, bar]
但它只有在完整的单词都在字符串中时才有效。例如,如果我使用“ba”和“foo”,我想得到相同的结果。我怎样才能实现它?
【问题讨论】:
标签: sql postgresql