I want to convert value of column into an array. But I don't know how. Can anyone help?
Below is the structure of table that I want to change.
[{"entity":"Job","value":"400072 "},{"entity":"Job","value":"400087"}]
Expected result:
[{"entity":"Job","value":[400072, 400087]}]
The code I tried :
SELECT (
SELECT ose.TaggedEntity AS 'entity', ose.TaggedEntityId AS 'value'
FROM #OldSharedEntity AS ose
WHERE ose.TaggedEntityId NOT IN (
SELECT nse.TaggedEntityId
FROM #NewSharedEntity AS nse
)
FOR JSON PATH, INCLUDE_NULL_VALUES
) AS json

