UNION ALL is a SQL set operation that returns all rows from two different select statements. Unlike with Union, duplicate rows are NOT removed from the result set. As a result, UNION ALL is faster than a UNION.
For example, the below query will return all rows from table_A and table_B (may contain duplicate rows):
SELECT * FROM table_A UNION ALL SELECT * FROM table_B;
- Minus - return rows that's in table A, but not in table B
- Intersect - only return rows that are in both tables
- Union - combine rows from tables and remove duplicates
|Glossary of Terms