Retaining Duplicate Rows Using the ALL Option - Teradata Database

SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Language
English (United States)
Last Update
2018-09-24
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata® Database

Retaining Duplicate Rows Using the ALL Option

Unless you specify the ALL option, duplicate rows are eliminated from the final result. The ALL option retains duplicate rows for the result set to which it is applied.

Example  

The following query returns duplicate rows for each result set, including the final:

   SELECT statement_1
   UNION ALL 
   SELECT statement_2 
   MINUS ALL 
   SELECT statement_3 
   INTERSECT ALL 
   SELECT statement_4