mysql拼接json数据

select a1.b1,c1,d1,json_replace('{"aaaaa":"1","bbbbb":"2","ccccc":"3","ddddd":"4"}','$.aaaaa',a1,'$.bbbbb',b1,'$.ccccc',c1,'$.ddddd',d1) as json_tt FROM test;

结果

{“aaaaa”:11111,"bbbbb":2,"ccccc":333,"ddddd":4444}

posted @ 2022-02-18 18:34  闫月Emily  阅读(322)  评论(0编辑  收藏  举报