我的表(user_profile)中有一个数据类型为json的列(display_settings)。存储的值将在此格式中。
{"privacy":{"goals":"public","groups":"public","friends":"public","gVisibility":1,"cVisibility":1,"fVisibility":1},"name":"default","diary":{"font":{"family":"Arial","size":"14","color":"#000000","weight":"normal","bgcolor":"#ffffff","style":"normal","decoration":"none"}}}
我只想获得
的关键值privacy.fVisibility
在postgress中使用查询。请建议我从json获取特定键值的方法。 json值也将从另一个选择查询中获得。
答案 0 :(得分:1)
SELECT privacy->'fVisibiity'AS fVisibility FROM table_name;