List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:November 2 2001 10:26pm
Subject:Re: changing column order in MySQL tables?
View as plain text  
At 2:12 PM -0800 11/2/01, Bennett Haselton wrote:
>How do you change the order of columns in MySQL tables?  I assume 
>the tables have a concept of column order, since the DESCRIBE 
>command always lists the columsn in the order in which they were 
>created.
>
>I figured that the place to look would be the syntax page for the 
>ALTER TABLE statement:
>	http://www.mysql.com/doc/A/L/ALTER_TABLE.html
>but there's nothing there about how to change the order of columns.

You can specify the position with a FIRST or AFTER col_name clause
when you add a column, but not (as far as I know) change the position
of an existing column.

Do you have some weird application requirement that makes this necessary?
You can always name the columns in the order you want them to come
out, when you issue a SELECT query.

>
>	-Bennett
>
>bennett@stripped     http://www.peacefire.org
>(425) 649 9024

Thread
changing column order in MySQL tables?Bennett Haselton2 Nov
  • Re: changing column order in MySQL tables?Paul DuBois2 Nov
    • RE: changing column order in MySQL tables?Bill Blowitz2 Nov
    • Re: changing column order in MySQL tables?Bennett Haselton3 Nov
  • RE: changing column order in MySQL tables?Carsten H. Pedersen3 Nov