views:

425

answers:

2

Hi, what is the easiest way to copy the all the values from a column in a table to another column in the same table?

+4  A: 

This script will update ALL values in the field1 with the values from the field2 in the corresponding row

UPDATE table SET field1 = field2
Ilya Kochetov
+8  A: 

With a single statement (if the columns have the same datatype)

UPDATE <tablename>
SET <destination column name> = <source column name>
Panagiotis Korros