[thelist] MYSQL - Add field to table with data for existing records

apathetic apatheticgenius at gmail.com
Thu Oct 12 12:46:38 CDT 2006


> I also know I can do this with two statements - first ALTER then UPDATE but
> wondering if it can be done in one go.

I'm pretty sure this is always going to require 2 statements.  Either
ALTER then UPDATE, or ALTER...SET DEFAULT then ALTER...DROP DEFAULT.

There doesn't seem to be any other option in the syntax:
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

Tim



More information about the thelist mailing list