tags:

views:

30

answers:

2

I have around 100,000 records in my Oracle table.

TableMaster
-----------
TabID
Column1
Column2

How do I update all the records so that Column1 values are moved to Column2, and Column2 values are moved to column1?

+2  A: 

Would this work?

UPDATE TableMaster SET Column1 = Column2, Column2 = Column1
Adam Batkin
+1 yes it would
Tony Andrews
+2  A: 

Modify the table, changing the column names.

Blank Xavier
+1 Interesting lateral thinking!
Tony Andrews
+1, however this will also swap any constraints on the columns, for good or ill
Jeffrey Kemp