I am using SQL and am trying to update my existing JSON fields. I no longer need the header and want to add a new value to the existing JSON field in its place.
The old JSON field looks like this:
[{"header":"C","value":"test1"},{"header":"D","value":"test2"},{"header":"E","value":"test3"}]
I want the new JSON field to look like this:
[{"oldValue":"test1","newValue":""},{"oldValue":"test2","newValue":""},{"oldValue":"test3","newValue":""}]
I tried:
UPDATE Files
SET Columns = JSON_MODIFY(Columns, '$.oldValue', JSON_QUERY(Columns, '$.header'))