Example: Attributes-Set-Result - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

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.