检查JSON类型列PostgreSQL中是否存在该字段 [英] Check if field exists in json type column PostgreSQL
本文介绍了检查JSON类型列PostgreSQL中是否存在该字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您如何检查Postgres中的 json
字段是否具有特定元素?
How do you check if a json
field in Postgres has a certain element?
我尝试过 json->>'attribute'不为空
并且不起作用。
I have tried with json->>'attribute' is not null
and doesn't work.
推荐答案
使用->
:
where (json->'attribute') is not null
这篇关于检查JSON类型列PostgreSQL中是否存在该字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文