在 Postgres JSONB 中,是否可以这样做:
where (
description ->'Auditor'->'1'->'Internal|External' is not null
)
取而代之的是:
where (
description ->'Auditor'->'1'->'Internal' is not null
or
description ->'Auditor'->'1'->'External' is not null
)
最佳答案
您可以使用 ?|
检查 jsonb 值是否具有一组键中的任何一个:
where description->'Auditor'->'1' ?| array ['Internal','External']
关于sql - Postgres 中 JSON 查询中的 OR 子句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47019256/