Create view v_Test
As
Select * from a
Union a
Select * from b
Union all 
select c

解决方案 »

  1.   

    Create view v_Test
    As
    Select * from a
    Union all
    Select * from b
    Union all 
    select cor Select * into 总表 from a
    Union all
    Select * from b
    Union All 
    Select * from c
      

  2.   

    Create view v_Test
    As
    Select * from a
    Union all
    Select * from b
    Union all 
    select * from c------------三表结构要一致
      

  3.   

    Create view v_Test
    As
    Select * from a
    Union all
    Select * from b
    Union all 
    select c
      

  4.   

    select * into 新表 from (
    Select * from a
    Union all
    Select * from b
    Union all 
    select * from c) tem
      

  5.   

    ----保留重复记录
    create view v_name
    as
    Select * from a
    union all
    Select * from b
    union all 
    select c----不保留重复记录
    create view v_name
    as
    Select * from a
    union
    Select * from b
    union
    select c
      

  6.   

    如果三张表的结构一样:1.不包括重复的记录:
    create view v_name 
    as
    select col1,col2,col3........ from a  --这边最好用列的名称来作为一个新表的字段名
    union
    select * from b
    union
    select * from c
    2.包括重复的记录:
    create view v_name 
    as
    select col1,col2,col3........ from a
    union all
    select * from b
    union all
    select * from c
      

  7.   

    如果结构不一样:
    可以用0或'0'代替一个列,如果是连接的第一个表需赋于一个列名,再连接起来比如:
    create view v_name 
    as
    select 0 as col1,col2,col3 from a
    union all
    select col1,0,col2 from b
    union all
    select col1,'0',0 from c
      

  8.   

    create view v_name 
    as
    select 0 as col1,col2,col3 from a
    union all
    select col1,0,col2 from b
    union all
    select col1,0,'0' from c  --这里修改一下要注意类型的对应.
      

  9.   

    select * into tablea  from (Select * from a
    Union all
    Select * from b
    Union all 
    select * from c)
    or create view v_name 
    as