aeran aeran - 2 years ago 109
MySQL Question

Mysql - How to update a column using another column's value plus some strings

I have a table with the following column & value:

ColA = "8765"
ColB = "2137"

I would like to update ColB in the same table to the following value:

ColC = "[8765][2137]"

How can I do it using phpmyadmin (meaning just sql syntax)?

Answer Source
UPDATE table SET ColC = CONCAT("[", ColA, "][", ColB, "]");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download