Is there a way to move a mysql field? I tried this but it didn't work:
ALTER TABLE `db`.`test` MOVE `field1` AFTER `field2`
Is this possible? If you don't know do you know where I can find out?
Thanks
Move MySQL Field???
Moderator: General Moderators
according to phpmyadmin, its
ALTER TABLE `newsusers` CHANGE `startdate` `startdate` TIMESTAMP( 14 ) DEFAULT NULL
http://www.mysql.com/doc/en/ALTER_TABLE.html
abotu 1/3 of the way down
ALTER TABLE `newsusers` CHANGE `startdate` `startdate` TIMESTAMP( 14 ) DEFAULT NULL
http://www.mysql.com/doc/en/ALTER_TABLE.html
abotu 1/3 of the way down
according tot he mysql website theres no such thing as ALTER - MOVE. So im assuming what you are trying to do is rename your collumns (if you are moving then probably the easiest thing to do would be to rename the collumn and then recreate the old collumn)You can rename a column using a CHANGE old_col_name create_definition clause. To do so, specify the old and new column names and the type that the column currently has. For example, to rename an INTEGER column from a to b, you can do this:
mysql> ALTER TABLE t1 CHANGE a b INTEGER;