select * from tableA
union -->重復記錄不選
select * from tableB
select * from tableA
union  all -->重復記錄
select * from tableB

解决方案 »

  1.   

    如果兩個表字段不一樣,但你用union 連接時,兩個select 語句的字段數量一樣多,而且字段的數據類型也一樣就可以了
    你測試一下就知道了
      

  2.   

    1.用视图
    create view V_tableAB
    as 
    select * from tableA
    union 
    select * from tableBselect * from V_tableAB