List:General Discussion« Previous MessageNext Message »
From:Ranjeet Walunj Date:July 30 2008 7:54pm
Subject:Re: Re-arranging fields
View as plain text  
Jerry Schwartz wrote:
> Is there any reasonable way of re-arranging the order of columns in a table
> without losing their data? The best I could come up with was to copy the
> table, empty it, and then do an INSERT . SELECT specifying the new order of
> the fields.

This can also be achieved in following manner.

a) Rename table to tablename_new
b) create table Tablename (fieldnames and datatypes) Select 
field1,field2...fieldn from tablename_new;

But why do you want to do it in first place ?

Regards,
Ranjeet Walunj
Thread
Re-arranging fieldsJerry Schwartz30 Jul
  • Re: Re-arranging fieldsRanjeet Walunj30 Jul
    • RE: Re-arranging fieldsJerry Schwartz31 Jul
      • RE: Re-arranging fieldsMr. Shawn H. Corey31 Jul
        • RE: Re-arranging fieldsJerry Schwartz31 Jul
          • RE: Re-arranging fieldsMr. Shawn H. Corey31 Jul
            • RE: Re-arranging fieldsJerry Schwartz31 Jul
  • Re: Re-arranging fieldsRob Wultsch30 Jul
    • Re: Re-arranging fieldsRob Wultsch31 Jul
    • RE: Re-arranging fieldsJerry Schwartz31 Jul
  • Re: Re-arranging fieldsMr. Shawn H. Corey30 Jul
    • RE: Re-arranging fieldsJerry Schwartz31 Jul
  • Re: Re-arranging fieldsMartijn Tonies31 Jul
    • RE: Re-arranging fieldsJerry Schwartz31 Jul