Hi,

Is there a solution for "moving" a column in a table from a position to
another?

I tried various "alter table" configurations.

The only solution i found was (trying to "move" IMcreatedat):

# Add temporary column:
Alter table Images add column
    temp datetime NOT NULL default '0000-00-00 00:00:00' after IMccdtemp;
# Copy values from IMcreatedat
update Images set temp = IMcreatedat;
# Delete original column
alter table Images drop column IMcreatedat;
# Rename temporary col:
alter table Images change column temp
    IMcreatedat datetime NOT NULL default '0000-00-00 00:00:00';

Any shorter solution?
Cheers,
Gaspar

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to