Combines the results of two or more select statements.
select-without-order-by … UNION [ ALL ] select-without-order-by … [ UNION [ ALL ] select-without-order-by ]… … [ ORDER BY integer [ ASC | DESC ] [, …] ]
SELECT Surname FROM Employees UNION SELECT Surname FROM Customers
The results of several SELECT statements can be combined into a larger result using a UNION clause. The component SELECT statements must each have the same number of items in the select list, and cannot contain an ORDER BY clause. See FROM Clause.
If corresponding items in two select lists have different data types, SAP Sybase IQ chooses a data type for the corresponding column in the result, and automatically converts the columns in each component SELECT statement appropriately.
The column names displayed are the same column names that display for the first SELECT statement.