I'm trying to update a column in my table, but that column stores a JSON Object, but for that I need to do a where with a JSON as well.
This is how the data is stored in my RG column:
{
"Id":"00000",
"Number":"12345678",
"Emitter":"SSP/SP",
"Uf":"SP",
"Emission":"2020-03-04T03:00:00Z"
}
First I would like to know what is wrong with this SELECT statement:
select * from People where JSON_VALUE (Rg, '$.Uf') LIKE '%35%'
And my UPDATE command I tried to do as follows:
update People set Rg = JSON_MODIFY (Rg, '$.Uf', 'SP') where JSON_VALUE (Rg, '$.Uf') LIKE '%35%'
Could someone help me make the select and this update, please? And what's wrong with my commands? I couldn't understand how to do these two commands when a JSON OBJECT is involved.