Example: Attributes-Set-Result - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

In the next query, the SELECT order is reversed:

   SELECT level, param 'GMKSA CONTROL' (TITLE 'OWNER')
   FROM gmksa_control
   WHERE cycle = '03'
   UNION 
   SELECT level, param, 'GMKSA'
   FROM gmksa
   WHERE cycle = '03'
   ORDER BY 1, 2;

This query returns the following answer set:

   ***QUERY COMPLETED.10 ROWS FOUND. 3 COLUMNS RETURNED.
   LEVEL   PARAM     OWNER
   -----   -----     ------------- 
   00      A         GMKSA
   00      A         GMKSA CONTROL
   00      T         GMKSA
   00      T         GMKSA CONTROL
   85      X         GMKSA
   85      X         GMKSA CONTROL 
   SF      A         GMKSA
   SF      A         GMKSA CONTROL
   SF      T         GMKSA
   SF      T         GMKSA CONTROL

Because the first SELECT specified GMKSA CONTROL, the rows were not duplicates and were included in the answer set.