Take the 2-minute tour ×

is it possible to copy data from all records in tables column A, to the column B in SQL?

Thanks in advance

share|improve this question
possible duplicate of How to copy data from one column to other column –  Daniel DiPaolo Jun 10 '11 at 15:31
add comment

3 Answers

up vote 16 down vote accepted

How about this

UPDATE table SET columnB = columnA

This will update every row.

share|improve this answer
add comment

An "insert into select" statement is what you are looking for.

SQL Insert into ... values ( SELECT ... FROM ... )

share|improve this answer
That would create a new table. I don't think thats what the OP is asking for. –  Ash Burlaczenko Jun 10 '11 at 15:39
It would actually insert records into an existing table. –  Abe Miessler Jun 10 '11 at 15:50
You're right. Thanks. I misunderstood that they were talking about the same table. –  feathj Jun 10 '11 at 15:51
add comment

UPDATE table_name SET destination_column_name=orig_column_name WHERE condition_if_necessary

share|improve this answer
How does this differ from the old accepted answer –  Mark Feb 26 at 13:04
add comment

Your Answer


