Union- It combines two more queries and removes the duplicates.
UnionAll- It combines two more queries and keeps the duplicates.
For example: TableA has 1,2,3 and Table B has 3,4,5Union Result will be 1,2,3,4,5 (It removes the duplicate 3)Union All Result will be 1,2,3,3,4,5 (It keeps the duplicate 3)
Which one will be faster?Union All will be faster, as it does not remove the duplicates.
Union All return all rows from tables even duplicate also, however, Union exclude duplicate rows from tables.
UNION: only keeps unique records. UNION ALL: keeps all records, including duplicates