UPDATE command on a JSON

Asked

Viewed 119 times

1

Good afternoon, everyone,

I’m trying to update a column of my table, but this column stores a JSON Object, only that for this I need to make a where with a JSON also.

This one is how the data is stored in my ID column:

inserir a descrição da imagem aqui

First I would like to know what is wrong with this SELECT command:

select * from Pessoas where JSON_VALUE(Rg, '$.uf') LIKE '%35%'

And my UPDATE command I tried to do as follows:

update Pessoas set Rg=JSON_MODIFY(Rg, '$.Uf', 'SP') where JSON_VALUE(Rg, '$.uf') LIKE '%35%'

Could someone help me select and update, please? And what’s wrong with my commands? I couldn’t figure out how to do these two commands when there’s one JSON OBJECT involved.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.