I want to concatenate two columns in a table with a existing column name using mysql.
An example: I am having a column FIRSTNAME
and LASTNAME
and so many columns also. I want to concatenate these two columns with the name of FIRSTNAME
only.
So I tried like this:
SELECT *, CONCAT(FIRSTNAME, ',', LASTNAME) AS FIRSTNAME FROM `customer`;
but it displaying the two fields with the name of FIRSTNAME
. one field is having normal values and another one is having concatenated values. I want only one column with those concatenate value. I can select single columns, but am having more than 40 columns in my table.
Is there any way to remove the original column using mysql itself?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…