: am trying to use part of a JSON to use as a filter for a where in clause as follows:
declare @json nvarchar(max) =
'[{
"brand_name": {
"key": "Brand Name",
"value": "''alpha'',''omega''"
}
}]';
select *
from someTable
where column in (select json_value(@json, '$[0].brand_name.value'));
How do I convert the value
into a where-in argument?
Like this:
declare @json nvarchar(max) =
'[{
"brand_name": {
"key": "Brand Name",
"value": ["alpha","omega"]
}
}]';
select value from openjson(@json, '$[0].brand_name.value')