Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您如何检查jsonPostgres 中的字段是否具有特定元素?
json
我试过了json->>'attribute' is not null,但没有用。
json->>'attribute' is not null
使用->:
->
where (json->'attribute') is not null
虽然这有效。最好使用特殊运算符?:
?
WHERE your_column_name::jsonb ? 'attribute'
注意:仅适用于jsonb类型。
jsonb