In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Bob Stone) wrote:

> I cannot find any documentation on how to copy the
> data from one mysql table to another, i.e. table1,
> columnx to table2, columnx.

See the mysql documentation of the "insert into" syntax for how to use a 
trailing "select" statement to get the values to be inserted.  In a single 
statement you can select the data from one table and insert it into 
another.  Example: "insert into table2 (p_key,data) select p_key,data from 
table1 where p_key >100 and data !='garbage'"

(This also works for "replace into" and "create table" statements, BTW.  
Nifty, eh? <g>)

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to