从多个表中复制数据并插入到一个表中


copying data from multiple table and insert into one?

我想从多个表中复制数据并插入到同一数据库的一个表中。 我怎样才能用PHP和MySQL做同样的事情?

与您的问题一样笼统,一个示例插入查询:

insert into table3(col1, col2, col3, col4) select t1.col1, t1.col2, t2.col1, t2.col2 from table1 t1, table2 t2 where t1.idColumn = t2.colID