select *
into 新表名
from (select * from T1 union all select * from T2)
這個語句可以實現將合並的數據追加到一個新表中。
不合並重復數據
select * from T1 union all select * from T2
合並重復數據
select * from T1 union select * from T2
兩個表,表1 表2
如果要將 表1的數據並入表2用以下語句即可
insert into 表2(字段1,字段2) select 字段1,字段2 from b1
注意,必須把字段名全部寫清楚,而且不允許把自動編號進去寫進去,要合並自動編號字段必須重寫一個算法一條一條記錄地加進去
1 insert into b1 select * from b2
2 select * into newtable from (select * from b1 union all select * from b2)
本文來自:http://hi.baidu.com/zagelover/item/4906208eb533dbd75f0ec179