Tag Archives: Concat fields in one field

Combining two fields data into one field in the same database table

If you only want to display the name after combining the fields then simply use:
SELECT CONCAT(first_name, ‘ ‘, last_name) AS full_name FROM table_name;

But if you want to save them in a separate db field then use UPDATE query. To update all the records in the table in one shot use:

UPDATE table_name SET full_name = CONCAT(first_name, ‘ ‘, last_name);