tags:

views:

84

answers:

1

I need to move the position of existing columns (for better visibility).

How can this be done without affecting the data?

+5  A: 

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;
soulmerge
Or `... AFTER OTHER_COLUMN`
Alexander Konstantinov