Re: Migrating MySQL Table Data

From: Date: Sun, 04 Feb 2001 16:13:28 +0000
Subject: Re: Migrating MySQL Table Data
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6359@lists.php.net to get a copy of this message
Hi, You can use "insert into newTable(field1,field2,field3) select red,green,blue from oldTable" HTH Jaski At 10:11 PM 2/4/01 +1300, phobo wrote: >I am in the process of improving a database scheme considerably in MySQL, by >breaking tables into smaller tables and so one. I am wondering if there is a >simple SQL statement to take ALL ROWS of fields 'f1', 'f2', 'f3', >and copy >them to the another table.... Then I can remove the fields in the original >table. > >eg something like >INSERT INTO BetterSmallerTable SET (PrimKey,Red,Green,Blue) VALUES (SELECT >PrimKey,Red,Green,Blue FROM BigClumsyTable) ?? > >Thanks, >Siggy > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >For additional commands, e-mail: php-db-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#6359) next »