UNION ALL
returns all the records while UNION
returns distinct records.
so you can use the DISTINCT
with UNION ALL
to make query same as UNION
as follows:
select distinct t.* from
(select * from table1
UNION ALL
select * from table2) t
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…