You can move a column in a MySQL table to another position like this:
ALTER TABLE name_of_the_table MODIFY column_to_move tinyint(1) DEFAULT '0' AFTER column_to_move_after
Note: the part with: “tinyint(1) default ’0′” is necessary and it should be the exact definition of your column.
For example yours might be:
int(10) unsigned NOT NULL auto_increment
or
int(10) unsigned NULL default ’0′
or
…
I'm the co-founder of
…but how does one move a column to the TOP of the table? So it is the first column?
Comment
Here it is:
http://codingrecipes.com/database-servers/mysql-rearrange-move-mysql-table-columns
Comment
To move the column to the top you would place it behind the one on top, then move the one on top below the 2nd.
Simple using the above SQL command.
Comment
You can use the FIRST keyword.
ALTER TABLE name_of_the_table MODIFY column_to_move tinyint(1) DEFAULT ’0′ FIRST
Comment