我有一个表[JsonTable],列[JsonData]保存json字符串,
JsonData 喜欢:
{
"Content": [
{
"ContentId": "123",
"Type": 1
},
{
"ContentId": "456",
"Type": 2
}
]
}
或者
[
{
"ContentId": "123",
"Type": 1
},
{
"ContentId": "456",
"Type": 2
}
]
我怎样才能像内部一样加入
SELECT* FROM [Content] AS C
INNER JOIN [JsonTable] AS J ON C.[Id] IN (SELECT value FROM OPENJSON(J.[JsonData],'$.Content.ContentId'))