【发布时间】:2021-03-25 23:45:53
【问题描述】:
我正在尝试创建一个 SQL 查询以从名为“CarOptions”的数据库中的列中收集信息。此列是一个包含 1 个或多个 JSON 对象的数组。下面是数组的一个例子。
我只想获取名称和价格的值。任何人都可以为我提供一个查询,该查询可以用名称和价格制定一个列,使其看起来像下面的示例或任何可读格式?
"Clear Guard 89500, Tint 0"
[
{
"id": 5,
"name": "Clear Guard",
"type": "ANY",
"grouping": "PREFER",
"price": 89500,
"oemOffering": false,
"learnMoreUrl": null,
"pricePercent": null,
"optionGroupId": 2,
"percentSource": null
},
{
"id": 119600,
"name": "Tint (Lifetime Warranty)",
"type": "NEW",
"grouping": "PREFER",
"price": 0,
"oemOffering": false,
"learnMoreUrl": null,
"pricePercent": null,
"optionGroupId": 18,
"percentSource": null
}
]
【问题讨论】: