E
E
Eduard Kanashevsky2016-08-01 15:05:17
MySQL
Eduard Kanashevsky, 2016-08-01 15:05:17

How to merge 2 columns in MySQL using PhpMyAdmin into one?

Let's say there is a customers table.
It has columns customers_firstname and customers_lastname.
It is necessary to combine them so that the textual information from them is displayed through a space in one column.
Those. was separately customers_firstname: Ivan , customers_lastname: Ivanov
and will be in the customers_firstname field (then I will rename or you can immediately create a new one): Ivan Ivanov

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
landergate, 2016-08-01
@kanashevskiy

Look:
Change:

UPDATE `customers` SET customers_fullname = CONCAT(customers_firstname, " ", customers_lastname);

K
Kirill Sharonov, 2016-08-01
@k_sharonov

https://habrahabr.ru/post/305926/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question