Page 1 of 1
Move MySQL Field???
Posted: Fri Aug 15, 2003 11:02 pm
by Mr. Tech
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
Posted: Sat Aug 16, 2003 6:24 pm
by Coco
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
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;
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)
Posted: Sun Aug 17, 2003 2:41 am
by Mr. Tech
OK thanks
