List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:July 31 2008 1:56pm
Subject:RE: Re-arranging fields
View as plain text  
>-----Original Message-----
>From: Ranjeet Walunj [mailto:ranjeet.walunj@stripped]
>Sent: Wednesday, July 30, 2008 3:55 PM
>To: Jerry Schwartz
>Cc: mysql@stripped
>Subject: Re: Re-arranging fields
>
>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;
[JS] Yes, that would work. I should have thought of it myself.
>
>But why do you want to do it in first place ?
[JS] I added a dozen or so columns for a special purpose, and although MySQL
doesn't care I wanted them in a certain order that would be intuitive to a
user / programmer.
>
>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