查询JSON类型字段下的具体某个值
json_unquote 的使用:
json_extract 的使用:
查询JSON例如:
SELECT json_unquote(json_extract (rules_tag.`json`,'$[0].value')) FROM rules_tag
SELECT json_unquote(json_extract (表名.`字段名`,'$[0].JSON键')) FROM 表名
添加JSON键值对:
update rules_tag set json = json_insert(json,"$.name",4) where id = 8400;
update 表名 set 字段名 = json_insert(字段名,"$.新增键","新增值") where 条件;