Howto combine two columns into one in mysql

This is how you can combine (or concatenate or merge) data from two table columns into one column using a mysql SQL query.

SELECT CONCAT(firstname,lastname) AS 'name' FROM tablename

The result would be “firstname lastname”

If you would like to insert this data into a new column

INSERT INTO tablename (full_name) SELECT CONCAT(firstname,lastname) AS 'name' FROM tablename

One Comment

  1. BaSingWolf 28. May 2015