Union all

From Oracle FAQ
Jump to: navigation, search

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;

Also see[edit]

  • 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
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #