Reputation: 1160
i have a mysql table structure :
emails( id , name , email )
how i can change the order of the table to
emails( id , email ,name )
Upvotes: 1
Views: 119
Reputation: 32953
Based on the comment you added, ie you want to copy table data between databases, have a look at SquirrelSQL and its DBCopy plugin, that might provide you with a more universal approach and leaner, faster way to achieve your goal. And it works between databases of different brands as well.
Upvotes: 0
Reputation: 31647
However, this should not be necessary if you adhere to best practices (like stating the names of the columns that you want to retrieve and the names of the columns that you want to set).
Upvotes: 0
Reputation: 4423
Looks like this is what you want.
ALTER TABLE emails MODIFY COLUMN name `name_data_type` after email;
Upvotes: 4
Reputation: 15537
Try this:
ALTER table `emails`
MODIFY COLUMN `name` your_data_type
AFTER `email`
Read more in the MySQL documentation.
Upvotes: 3