I have a table with one columns of integer data type. I want to add another columns with string data type.
Finally I want to copy the values in first column to the second columns. That means I want to copy the integer data from column one and copy that to second column in string format.
Casting the column to a CHAR
will do what you want:
UPDATE `table` SET column2 = CAST(column1 AS CHAR)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With