I need to move the position of existing columns (for better visibility).
How can this be done without affecting the data?
I need to move the position of existing columns (for better visibility).
How can this be done without affecting the data?
The only way I know is to change the column. You would first extract your column definition using SHOW CREATE TABLE
and issue an ALTER TABLE
:
ALTER TABLE foo
CHANGE COLUMN bar
bar COLUMN_DEFINITION_HERE
BEFORE OTHER_COLUMN;