select * from tableA
union -->重復記錄不選
select * from tableB
select * from tableA
union all -->重復記錄
select * from tableB
union -->重復記錄不選
select * from tableB
select * from tableA
union all -->重復記錄
select * from tableB
你測試一下就知道了
create view V_tableAB
as
select * from tableA
union
select * from tableBselect * from V_tableAB