search

Home  >  Q&A  >  body text

json added to MySQL

How to add new elements to json variables in mySQL

thus: value = ['123'] Do this: Value = ['123','456']

P粉939473759P粉939473759228 days ago459

reply all(1)I'll reply

  • P粉464088437

    P粉4640884372024-04-05 15:29:44

    JSON_ARRAY_APPEND() ; Function

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

    violin

    reply
    0
  • Cancelreply