I have the following:
CREATE Table apellidos_completo (Completo varchar (255))
INSERT INTO apellidos_completo (Completo )values ('alvarez')
UPDATE apellidos_completo set Completo = 'Rodriguez' + Completo
I do SELECT
SELECT *
FROM apellidos_completo
the result should be
'Rodriguez Alvarez'
However, the result obtained is:
(0) osea CERO
NOTE: if I do it in SQL server it works for me, Good but in MySQL it doesn't work.
The union, not the sum; It is done by means of the function
CONCAT()
, which helps me to concatenate or join several values, be guided by this exampleWithin your code it returns 0 because it is taking or trying to take the values such as those that can be added because you use the + sign, since it is not of numeric type it returns 0
In any case, what you are looking to obtain is not the sum of the text strings but the concatenation of them, which is very different.