aeran aeran - 5 months ago 15
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
UPDATE table SET ColC = CONCAT("[", ColA, "][", ColB, "]");
Comments