SQL Command – Copy Data from One Column to Another

Time to read: 2 mins

First, you need to know the following bits of information:

Database Name
For this purpose, we will call the database name “DATABASE”

Table Name
For this purpose, we will call the table name “TABLE”

Column A (Where the data will come from)
For this purpose, we will call this column “COLUMNA”

Column B (Where the data is going to)
For this purpose, we will call this column “COLUMNB”

SELECT TABLE, COLUMNA, COLUMNB FROM TABLE
UPDATE TABLE SET COLUMNB = COLUMNA

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.