Jump to content

MySQL: How to copy/move values from one table into another?


bachx

Recommended Posts

http://dev.mysql.com/doc/refman/4.1/en/insert-select.html

 

INSERT INTO tbl_temp2 (fld_id)

  SELECT tbl_temp1.fld_order_id

  FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;

 

$sql = "INSERT INTO table_name (`col1`, `col2`) SELECT col1,col2 FROM table_name2 WHERE CONDITION=TRUE;";

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.