SQL - Update without losing values

0

Well my personal question is the following I would like to update a value in the "Database" without losing the value there already allocated, Good for better understanding of my doubt Irie cite an example: I have a CALLED TABLE: Clients; With columns: name, age, sentence.

I have the following data there > name age phrase lucas 20 good

I would like to update the phrase without losing what you already have in it ie:

UPDATE Clientes
SET frase='dia'
WHERE nome='lucas';

In other words, I would like him not to change the phrase to "day", but to concatenate, I wanted it to be > Good Morning. It updates keeping the value it already has there. Thanks in advance.

    
asked by anonymous 06.01.2016 / 03:47

1 answer

2

Using the CONCAT function you can do this.

UPDATE Clientes SET frase = CONCAT(frase, 'dia') WHERE nome='lucas';

Functional example here .

    
06.01.2016 / 04:14