34,593
社区成员
发帖
与我相关
我的任务
分享
select * from a
union all
select * from b
如果要是真有重复的记录,那么可以通过union 来合并并且去重:
select * from a
union
select * from b
select * from A
union --怕以后有重复
select * from B
select * into 新表
from
(
select * from a
union all
select * from b
)t
如果你想合并后,数据放到a表那么可以这样:
insert into a
select *
from b
select * into 表c from 表A where 1=2
insert into 表c
select * from 表A
union all
select * from 表B
select * from 表c