Tuesday, January 13, 2009

Copying data from one column to another column in same table

SQL> update [table_name] set [new_column]=[old_column];
The entries from old column will be copied to the new column in the same table.

Ex:
SQL> update sample set location=sname;
4 rows updated.

SQL> select * from sample;

SNO SNAME LOCATION
---------- -------------------- --------------------
1 vinay vinay
2 suman suman

No comments:

Post a Comment