title: How do I create a column that is a concatenation of two other columns in mariadb?
body: <p>I am redesigning a database that my manager made as I my first project after being promoted to IT. I started by copying everything over and cleaning it up. I noticed later that the "Employees" table had columns for first name and last name, but all the other tables reference the employees by their full name, they need to be relational, so I wanted to change the Employee List table to use full name only and get rid of the unnecessary columns for first name and last name.</p>
  
  <p>I have tried to concatenate the first and last name columns into one column, but the only times that I have used correct mariadb syntax the tables only show 0 in the field. Here are some examples of what has not worked:</p>
  
  <p>Result is 0:</p>
  
  <pre><code>ALTER TABLE employees
  ADD COLUMN Employee VARCHAR(50)
  AS (first_name || ' ' || last_name);
  
  UPDATE TABLE employees
  SET Employee = first_name + last_name;
  </code></pre>
  
  <p>I'm assuming this doesn't work because it is for numbers, there would also be no space.</p>
  
  <p>Syntax error:</p>
  
  <pre><code>ALTER TABLE employees
  ADD COLUMN Employee VARCHAR(50)
  AS (first_name, ' ', || last_name);
  </code></pre>
  
  <p>error in ' ' ', last_name)' This syntax only works for CONCAT, but that doesn't seem to work here either.</p>