Add to json in MySQL

chhqkbe1  于 2022-12-22  发布在  Mysql
关注(0)|答案(1)|浏览(97)

How add to json varible a new element in mySQL
From this: Value = ['123'] Make this: Value = ['123','456']

6kkfgxo0

6kkfgxo01#

JSON_ARRAY_APPEND() function

SET @Value = '["123"]';
SET @Value = JSON_ARRAY_APPEND(@Value, '$', '456');
SELECT @Value;
@Value
["123", "456"]

fiddle

相关问题