Skip to content
Advertisement

UPDATE command in a JSON

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:

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

And my UPDATE command I tried to do as follows:

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.

Advertisement

Answer

Both your SELECT query and UPDATE statements are fine. I tried below with test setup. I did not face any issue.

Test Setup

Running Select Query

Updating and Selecting to verify whether update was successful

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement