Home > MySQL > How to move a column in MySQL

How to move a column in MySQL

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;

Categories: MySQL Tags:
  1. June 11th, 2009 at 18:54 | #1

    Thanks a lot for this. Exactly what I needed.

  1. No trackbacks yet.