Example: Select Statement - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
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.