I am using mysql 8.0.22
My sample table be like
| id | students | total_marks |
|---|---|---|
| 1 | {"students":[{"marks":100},{"marks":100},{"marks":100},{"marks":100}]} |
After update it should be
| id | students | total_marks |
|---|---|---|
| 1 | {"students":[{"marks":100},{"marks":100},{"marks":100},{"marks":100}]} | 400 |
I ahve to add all the marks in that json. I am able to write a stored procedure for that.
I am trying to do it in one query.
How can I do it? Thanks.