UNION
The results of two or more SELECT operations can be combined using the UNION set operator. This operator works in the same manner as Distinct. That means that after the UNION operation is performed, any possible duplicate rows will be eliminated. This is actually the main difference between UNION and UNION ALL.
Let us see the UNION operation in action by performing this operation on the two tables shown above. The query we’d have to run in order to do this is:
TEXT/X-SQL
1SELECT * FROM Table1
2UNION
3SELECT * FROM Table2;
The resulting table would look like this:
