Example: Merging Lists of Values - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
vnq1596660420420.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

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 could 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 ;