0
Good personal my doubt 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 I would quote an example: I have a TABLE CALLED: Clients ; With columns: name, age, phrase.
I have the following data there > old phrase name Lucas 20 good
I would like to update the sentence without losing what is already in it:
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> bomdia. It updates keeping the value it already has there. Thanks in advance.
SET frase= frase +'dia'
?– rray
http://answall.com/q/43907/101
– Maniero
@rray in the case of integers, could put
SET cont = cont + '1'
who would act as an accountant?– Leonardo
I have tried this way but it does not work, it assigns 0. Yes Ivcs if it is the type int you doing this way it makes the sum and assigns without problems, It is a pity that in varchar type it does not concatenate :( .
– Viniam
Has Concat also.
– rray
@A more trivial way would be to write a query for the sentence column before the update, after that concatenate.
– Leonardo
Yes I already thought about it, however this way I would have to perform 2 queries, I want to do something more practical just a light concatenation, Got it?
– Viniam