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

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


You need to use the CONCAT() function in MySQL for string concatenation:

UPDATE categories SET code = CONCAT(code, '_standard') WHERE id = 1;


Update image field to add full URL, ignoring null fields:

UPDATE test SET image = CONCAT('https://my-site.com/images/',image) WHERE image IS NOT NULL;