A query specification or query expression that returns data to be combined with the data from another query specification or query expression. The definitions of the columns that are part of a UNION operation do not have to be identical, but they must be compatible through implicit conversion.
Specifies that multiple result sets are combined and returned as a single result set.
Incorporates all rows into the results, including duplicates. If not specified, duplicate rows are removed.
CREATE TABLE t1 (a int, b nchar(4), c nchar(4));
INSERT INTO t1 VALUES (1, 'abc', 'jkl');
INSERT INTO t1 VALUES (2, 'def', 'mno');
INSERT INTO t1 VALUES (3, 'ghi', 'pqr');
CREATE TABLE t2 (a nchar(4), b float);
INSERT INTO t2 VALUES('jkl', 1.000);
INSERT INTO t2 VALUES('mno', 3.000);
SELECT a, b FROM t1
SELECT b, a FROM t2;