数据库的存在的json字段
{"role": "COMPUTE", "vcpu": "1", "region": "ap-seoul-1", "userId": "12", "vendor": "oracle", "category": "COMPUTE_CLUSTER", "tenantId": "0", "clusterId": "7", "lifecycle": "ondemand", "scaleMode": "NONE", "fs-platform": "LINUX", "apiClusterId": "8", "cloudAccount": "FASTONE", "instanceType": "D3-c1-m4-g0", "partitionName": "partition0866", ".image_version": "7.5", "cloudImageName": "fs-centos-7.5", "deploy_node_id": "17", "fsInstanceType": "s2.c1.2"}
select * from event where resource_data->>'instanceType'='E4-c1-m4-g0'
resource_data 是数据库的字段名字
instanceType:是json中的key
‘E4-c1-m4-g0’:是json中的value
这篇博客探讨了一种数据库查询方法,通过查询resource_data字段中instanceType键的值来过滤记录。示例查询展示了如何在resource_data字段的JSON内容里查找等于'E4-c1-m4-g0'的instanceType。
1478

被折叠的 条评论
为什么被折叠?



