龙空技术网

Mysql数据类型JSON

大连赵哥 104

前言:

现时姐妹们对“mysql57json”都比较珍视,我们都需要了解一些“mysql57json”的相关资讯。那么小编也在网络上汇集了一些有关“mysql57json””的相关知识,希望你们能喜欢,小伙伴们快快来了解一下吧!

SELECT json_array(1,2,3,4,5);

SELECT json_object('nane','张三','age',30);

INSERT INTO t_json(config) VALUES(json_object('name','张三'));

INSERT INTO t_json(config) VALUES(json_object('name','李四','age',40));

SELECT * FROM t_json;

DELETE FROM t_json;

update t_json set config = json_set(config,"$.age","50");

update t_json set config = json_set(config,'$','{a:1,b:2}');

INSERT INTO t_json(config) VALUES('{"name":"张三","age":30}');

update t_json set config = json_set(config,"$.name","测试") WHERE id = 5;

SELECT * FROM t_json;

项目中具体应用案例:

INSERT INTO t_json(config) VALUES('

[

{"label":"基础训练",

"children":[

{"ischeck":false,"label":"部件学习","isfree":false},

{"ischeck":false,"label":"起步停车","isfree":false},

{"ischeck":false,"label":"换挡变速","isfree":false},

{"ischeck":false,"label":"倒车","isfree":false}

]},

{"label":"科目二单项",

"children":[

{"ischeck":false,"label":"倒车入库","isfree":false},

{"ischeck":false,"label":"侧方停车","isfree":false},

{"ischeck":false,"label":"直角转弯","isfree":false},

{"ischeck":false,"label":"曲线行驶","isfree":false},

{"ischeck":false,"label":"坡停坡起","isfree":false},

{"ischeck":false,"label":"雨雾湿滑路","isfree":false},

{"ischeck":false,"label":"模拟隧道","isfree":false}

]},

{"label":"科目二综合模拟",

"children":[

{"ischeck":false,"label":"科二综合训练","isfree":false},

{"ischeck":false,"label":"科二模考","isfree":false}

]},

{"label":"科目三",

"children":[

{"ischeck":false,"label":"科三训练","isfree":false},

{"ischeck":false,"label":"科三模考","isfree":false}

]},

{"label":"",

"children":[

{"ischeck":false,"label":"危险辨识","isfree":false}

]}

]

');

标签: #mysql57json