[英]SQL bigint array column contain any member of another array?
在我的模式中,我有 supply_source 作為bigint[]
。
我想查詢 mytable 中 supply_sources 中有123 或 456 的所有行。
當我使用此查詢時,我只獲得同時具有 123 和 456作為其 supply_source 的行。
SELECT *
FROM mytable
WHERE supply_source = ARRAY[123, 456]::bigint[]
LIMIT 10;
我應該如何修改我的查詢?
您可以使用數組重疊運算符&&
:
WHERE supply_source && ARRAY[123, 456]::bigint[]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.