Example: Select Statement - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Consider the following query:

   SELECT statement_1 
   UNION
   SELECT statement_2 
   EXCEPT 
   SELECT statement_3 
   INTERSECT 
   SELECT statement_4;

The operations are performed in the following order:

  1. Intersect the results of statement_3 and statement_4.
  2. Union the results of statement_1 and statement_2.
  3. Subtract the intersected rows from the union.