繁体   English   中英

Postgres中JSON查询中的OR子句

[英]OR clause inside JSON query in Postgres

在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']

相关文件

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM