sql 如何实现表的追加,即,将一个表里的数据添加到另外一张表里,两个表的结构是一样的。

2025-02-22 14:39:25
推荐回答(2个)
回答1:

可以这样
insert into table1 select * from table2 a where not exists(select * from table1 b where 主键关联)

回答2:

insert table1 select * from table2