By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
SET @a = '{
"Vocab": {
"username":"132423424",
"Mother": {
"code":"1",
"progress":"1",
"nextdate":"22-10-2020",
"lastcheck":"22-10-2020"
},
"Father": {
"code":"2",
"progress":"2",
"nextdate":"22-10-2020",
"lastcheck":"22-10-2020"
}
}
}';
SET @b = '{ "Brother": {
"code":"3",
"progress":"1",
"nextdate":"22-12-2020",
"lastcheck":"22-12-2020"
} }';
SELECT JSON_MERGE_PATCH(@a, @b);
JSON_MERGE_PATCH(@a, @b) |
---|
{"Vocab": {"Father": {"code": "2", "nextdate": "22-10-2020", "progress": "2", "lastcheck": "22-10-2020"}, "Mother": {"code": "1", "nextdate": "22-10-2020", "progress": "1", "lastcheck": "22-10-2020"}, "username": "132423424"}, "Brother": {"code": "3", "nextdate": "22-12-2020", "progress": "1", "lastcheck": "22-12-2020"}} |