首页 > 解决方案 > 将所有从 table1 插入到 table2 具有不同的表结构

问题描述

table1有列id what title 五列以上;

table2只有列和; _id whattitle

如何将所有行从 fromtable2插入到table1

insert into table1 select * from table2- 由于表结构不同而不起作用。

标签: mysql

解决方案


你可以试试下面 -

insert into table1(id, what, title) 
    select id, what, title from table2

推荐阅读