Home » RDBMS Server » Server Administration » Move data between columns
Move data between columns [message #373229] Thu, 05 April 2001 10:42 Go to next message
Arpit
Messages: 99
Registered: March 2001
Member
Hello,

Can someone please help me on this.

I need to move data between columns in a table. Ex: Need to move all the data in column1 to coulmn2 and data in column2 to column3 and data in column 3 to column1.

Any help on this would highly be appreciated.

Thanks!
Alpesh
Re: Move data between columns [message #373230 is a reply to message #373229] Thu, 05 April 2001 10:56 Go to previous messageGo to next message
Wendy
Messages: 4
Registered: April 2001
Junior Member
make a copy of your table ...
create table y as select * from x;
delete * from x;
insert into x (column1) select column3 from y;
insert into x (column2) select column1 from y;
etc...
Re: Move data between columns [message #373231 is a reply to message #373230] Thu, 05 April 2001 11:43 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
Who won't this work??

Update tab1
set col1 = col2,
col2 = col3,
col3 = col1;
Previous Topic: need help fast
Next Topic: Dynamic Triggers
Goto Forum:
  


Current Time: Mon Dec 23 06:20:02 CST 2024