Reputation: 15043
I want to move column OtherSupport
below Amount2
... is there an easy way to do this?
Upvotes: 2
Views: 3700
Reputation: 14864
ALTER TABLE myTable MODIFY OtherSupport VARCHAR(50) AFTER Amount2;
Upvotes: 7
Reputation: 596
Here I have a general solution for mysql by sql query
ALTER TABLE table_name MODIFY COLUMN misplaced_column Column-definition AFTER other_column; Here in Column-definition is full column definition. To see the column definition if you are using phpmyadmin click on structure tab. Then click on change link on desired column. Then withour modifyig any things click save. It will show you the sql. Copy the sql and just add *AFTER other_column* at the end. It will be all.
If you like to bring the *misplaced_column* to the first position then ALTER TABLE table_name MODIFY COLUMN misplaced_column Column-definition FIRST;
Upvotes: 3
Reputation: 838226
You're not the first one to ask. Here's the feature request.
Either do it using SQL or use MySQL Workbench.
Upvotes: 4