Example: Merging Lists of Values - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

In addition, the UNION operator is useful if you must merge lists of values taken from two or more tables.

For example, if departments 500 and 600 had their own Employee tables, the following query can be used to select data from two different tables and merge that data into a single list:

   SELECT Name, DeptNo 
   FROM Employee_dept_500 
   UNION 
   SELECT Name, DeptNo 
   FROM Employee_dept_600 ;