作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有没有办法在 postgres 中对字符串数组列进行部分字符串匹配?
我正在尝试以下语法,但它没有像我期望的那样工作:
SELECT * FROM example_table WHERE '%partial string' ILIKE ANY(array_column)
有正确的方法吗?
最佳答案
drop table if exists temp_a;
create temp table temp_a as
(
select array['alpha','beta'] as strings
union all
select array['gamma','theta']
);
select *
from (select unnest(strings) as string from temp_a) as sq
where string ilike '%eta'
关于sql - 如何在 Postgresql 中将 LIKE 与 ANY 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27491189/
我是一名优秀的程序员,十分优秀!