0

How do I get a proper field builded with the data of all names columns + the @sales.es?

The following just set all to 0.

ALTER TABLE comercial ADD COLUMN email VARCHAR(100) GENERATED ALWAYS AS 
    (nombre+'.'+ surname1 + surname2 +'@sales.es') VIRTUAL AFTER province;

1 Answers1

1

MariaDB uses CONCAT for string concatenation, not +.

So change your statement to this:

ALTER TABLE comercial
    ADD COLUMN email VARCHAR(100) GENERATED ALWAYS AS ( CONCAT( nombre, '.,  surname1, surname2, '@sales.es' ) ) VIRTUAL AFTER province;
Dai
  • 141,631
  • 28
  • 261
  • 374