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
   SELECT level, param, 'GMKSA' (TITLE 'OWNER')
   FROM gmksa
   WHERE cycle = '03'
   UNION
   SELECT level, param, 'GMKSA CONTROL'
   FROM gmksa_control
   WHERE cycle = '03'
   ORDER BY 1, 2;

The query returns the following results set:

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

The first SELECT specifies GMKSA, which is CHAR(5)—that data type is then forced on the second SELECT. Therefore, GMKSA_CONTROL entries are dropped because the first five characters are the same.

Because this query does not specify the ALL option, duplicate rows are dropped.