1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How can I append a string to an existing field in MySQL?

Discussão em 'Outras Linguagens' iniciado por Stack, Janeiro 27, 2021.

  1. Stack

    Stack Membro Participativo

    I want to update the code on all my record to what they currently are plus _standard any ideas?

    So for example if the codes are apple_1 and apple_2 I need them to be apple_1_standard and apple_2_standard

    Before:


    id code
    ------------
    1 apple_1
    1 apple_2

    Psuedo Query:


    update categories set code = code + "_standard" where id = 1;

    Expected result:


    id code
    ----------------------
    1 apple_1_standard
    1 apple_2_standard

    Continue reading...

Compartilhe esta Página