in reply to Generating ALTER TABLE code for MySQL
Some of this functionality is also available prior to 5.0 using the CREATE .. SELECT syntax.
I know it works in 4.1 and I think it works in 4.0, but you would need to check.CREATE TABLE new_tbl SELECT * FROM orig_tbl; MySQL creates new columns for all elements in the SELECT. For example: mysql> CREATE TABLE test (a INT NOT NULL AUTO_INCREMENT, -> PRIMARY KEY (a), KEY(b)) -> TYPE=MyISAM SELECT b,c FROM test2;
In Section
Seekers of Perl Wisdom