PostgreSQL数组查询是否存在某个值

语法

sql 复制代码
值 = =ANY (字段);

例子

查询ids中包含id=5的数据

sql 复制代码
select * from student where 5 = ANY (ids)
  • mybatis
xml 复制代码
select * from student where
#{id} = ANY (ids)
相关推荐
ZhongruiRao12 小时前
Springboot+PostgreSQL+MybatisPlus存储JSON或List、数组(Array)数据
spring boot·postgresql·json
x-cmd18 小时前
[241005] 14 款最佳免费开源图像处理库 | PostgreSQL 17 正式发布
数据库·图像处理·sql·安全·postgresql·开源·json
AI人H哥会Java18 小时前
【PostgreSQL】实战篇——使用 PostgreSQL 进行数据分析与报表生成
数据库·sql·postgresql
文牧之1 天前
PostgreSQL 和Oracle 表压缩的对比
运维·数据库·postgresql·oracle
踩着阴暗的自己向上爬2 天前
Day01-postgresql数据库基础入门培训
数据库·postgresql
PGCCC2 天前
【PGCCC】从 PostgreSQL 表恢复已删除的数据 | 翻译
数据库·postgresql
老年DBA2 天前
postgresql-重复执行相同语句,试试 prepare!
数据库·postgresql
music score3 天前
Ubuntu编译fftw3
linux·ubuntu·postgresql
AI人H哥会Java4 天前
【PostgreSQL】入门篇——索引:提高查询性能的利器
数据库·sql·postgresql
AI人H哥会Java4 天前
【PostgreSQL】提高篇——公用表表达式(CTE)和窗口函数
数据库·sql·postgresql