>-----Original Message----- >From: Ranjeet Walunj [mailto:[EMAIL PROTECTED] >Sent: Wednesday, July 30, 2008 3:55 PM >To: Jerry Schwartz >Cc: mysql@lists.mysql.com >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
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]