msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

06 Sep 2009 Howto combine two columns into one in mysql

Posted by

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

Tags: , ,

Comments are closed.