Archive for the ‘MySQL’ Category

How to move a column in MySQL

Wednesday, August 13th, 2008

Move a column after some other column

mysql> ALTER TABLE mytable MODIFY COLUMN mycolumn INT AFTER someothercolumn;

Move a column to the first position

mysql> ALTER TABLE mytable MODIFY COLUMN mycolumn INT FIRST;