假设我有下表 产品
Let's say I have the following table Product
您可以使用嵌套的 FOR JSON 子查询,该子查询使用 OPENJSON 打开原始 JSON 并重新聚合它
FOR JSON
OPENJSON
SELECT p.ProductID, p.ProductName, ( SELECT p.ProductID, p.ProductName, j.Price, j.Shipper FROM OPENJSON(p.Results, '$.Results') WITH ( Price int, Shipper varchar(100) ) j FOR JSON PATH, ROOT('Results') ) AS Results FROM Product p;
You can use a nested FOR JSON subquery, which breaks open the original JSON using OPENJSON and re-aggregates it
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
您可以使用嵌套的
FOR JSON
子查询,该子查询使用OPENJSON
打开原始 JSON 并重新聚合它You can use a nested
FOR JSON
subquery, which breaks open the original JSON usingOPENJSON
and re-aggregates it