mysql中对json数据的属性进行更改或者添加

通过json_set进行对json字段的键值进行修改,如果存在就进行替换,如果不存在键值,就增加键值对.
update test  set json_data = json_set(json_data, "$.menu", 'asd') where true and user_id = '111111'

发布了63 篇原创文章 · 获赞 10 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_30966497/article/details/102584172
今日推荐