得到新表:select * into xx from (
select 列1,列2 from 表1
union all
select 列1,列2 from 表2
) tem插入一个旧表:
insert 目标表 (列1,列2) select 列1,列2 from 表 where xx=1

解决方案 »

  1.   

    主要分清几个表的关联键就可以了。
    select a.A,b.B,c.C from A
    join B ..
    join c ..
      

  2.   

    --横向合并
    select a.*,b.*,c.* from a,b,c where 条件--纵向合并
    ----去掉重复数据的合并
    select * from a 
    union 
    select * from b
    union 
    select * from c----不去掉重复数据的合并
    select * from a 
    union  all
    select * from b
    union all
    select * from c