【发布时间】:2021-01-24 23:30:40
【问题描述】:
在我的架构中,我的 supply_source 为 bigint[]。
我想查询 mytable 中所有在其 supply_sources 中有 123 或 456 的行。
当我使用这个查询时,我只得到 123 和 456 作为其供应源的行。
SELECT *
FROM mytable
WHERE supply_source = ARRAY[123, 456]::bigint[]
LIMIT 10;
我应该如何修改我的查询?
【问题讨论】:
-
选择合适的数据库。
-
我删除了mysql标签,因为MySQL没有数组数据类型。
标签: sql arrays postgresql where-clause