mysql - 将所有从 table1 插入到 table2 具有不同的表结构
问题描述
table1
有列id
what
title
和五列以上;
table2
只有列和; _id
what
title
如何将所有行从 fromtable2
插入到table1
?
insert into table1 select * from table2
- 由于表结构不同而不起作用。
解决方案
你可以试试下面 -
insert into table1(id, what, title)
select id, what, title from table2