千家信息网

mysql8的json操作

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,insert into myTable (t_id,year,details) values (5,2019,cast('{"haha":[{"u":1,"t":123 }]}' as json))
千家信息网最后更新 2026年11月01日mysql8的json操作
insert into myTable (t_id,year,details) values (5,2019,cast('{"haha":[{"u":1,"t":123 }]}' as json)) SELECT id  FROM myTable where id=4 and json_contains_path(details->'$[*]', 'one','$[*].haha'); update myTable set details=JSON_ARRAY_APPEND(details,'$[1].haha',cast('{"u":2,"t":999}' as json)) where id=5
0