Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

phpmyadmin combine text and column in SET SQL

I’m trying to use the existing values in columns to create a new column using phpmyadmin.

I currently have the following database.

| First_Name | Second_Name    | Full_Name |
| ---------- | -------------- | --------- |
| Paul       | Smith          |           |
| Mike       | Wazowski       |           |

...

I have first names and second names, but I’m wanting to insert data into full name with some text. I have used this command below to insert data:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

UPDATE `users` SET `Full _Name`='some text' + `First_Name`;

However that returns the problem Truncated incorrect DOUBLE value.

>Solution :

That should work:

UPDATE users SET Full_Name = CONCAT(First_Name," ",Second_name)

https://www.w3schools.com/Sql/func_mysql_concat.asp

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading